跳到主要内容

如何单击以放大或展开Word文档中的图像?

本文讨论的是如何通过单击鼠标来放大或扩展Word文档中的图像。

单击以使用VBA代码放大或扩展图像

使用 Kutools for Word 调整图像大小


单击以使用VBA代码放大或扩展图像

下面的VBA代码可以帮助您通过单击放大Word文档中的图像。 请执行以下操作。

1.在包含您要单击放大的图像的图像中,按 其他 + F11 键打开 Microsoft Visual Basic应用程序 窗口。

2.在 Microsoft Visual Basic应用程序 窗口中,单击 插页 > 类模块。 然后将下面的VBA代码复制到“类”窗口中。

VBA代码1:单击以放大图像

Public WithEvents GApp As Word.Application
'Updated by ExtendOffice 20181129
Private Sub GApp_WindowSelectionChange(ByVal Sel As Selection)
    Dim xShape As InlineShape
    On Error Resume Next
    Set xShape = Sel.InlineShapes(1)
    xShape.Height = 200
    xShape.Width = 200
End Sub

备注:在代码中,数字200是指定的放大图像的高度和宽度。 您可以根据需要更改高度和宽度。

3。 点击 插页 > 模块,将以下代码复制到“模块”窗口中。

VBA代码2:单击以放大图像

Dim cls As New Class1
'Updated by ExtendOffice 20181129
Sub register_Event_Handler()
    Set cls.GApp = Word.Application
End Sub

4。 按 F5 键来运行代码并关闭 Microsoft Visual Basic应用程序 窗口。

现在,单击此文件中的图像时,图像将根据需要放大到特定大小。


使用 Kutools for Word 调整图像大小

调整图像大小 实用程序 Kutools for Word 可以帮助您按指定的百分比或所选图像调整所有图像的大小。 请尝试一下。

Kutools for Word :拥有100多个方便的Word加载项, 免费试用,没有限制 60.

点击 Kutools 加 > 调整大小,从下拉列表中选择一个百分比。 看截图:

然后,基于此特定百分比调整当前文档中的所有图像的大小。

要根据所选图片的尺寸调整所有图像的大小,需要先选择图像,然后单击 Kutools 加 > 调整大小 > 通过选择调整图像大小。 看截图:

然后,根据选定的图像调整当前文档中的所有图像大小。

如果您想免费试用该实用程序,请转到 免费下载软件 首先,然后按照上述步骤进行操作。


Office Tab -Word中多个文档的选项卡式浏览,编辑和管理:

Office Tab 将 Google Chrome、Internet Explorer 新版本和 Firefox 等网络浏览器中的选项卡式界面引入 Microsoft Word。它 成为省时的工具,在您的工作中无可替代。 参见下面的演示:

点击免费试用Office Tab!

最佳办公生产力工具

Kutools for Word - 通过 Over 提升您的文字体验 100 显着特点!

🤖 Kutools 人工智能助手:用人工智能改变你的写作 - 生成内容  /  重写文本  /  总结文件  /  查询资料 基于文档,全部在Word中

📘 文档掌握: 分页  /  合并文件  /  以各种格式导出选择(PDF/TXT/DOC/HTML...)  /  批量转换为PDF  /  将页面导出为图像  /  一次打印多个文件...

内容编辑: 批量查找和替换 跨多个文件  /  调整所有图片的大小  /  转置表行和列  /  将表格转换为文字...

🧹 轻松清洁: 移开 多余的空间  /  分节符  /  所有标题  /  文本框  /  超链接  / 如需更多拆卸工具,请前往我们的 删除组...

创意插入: 插 千位分隔符  /  复选框  /  单选按钮  /  扫码支付  /  条码  /  对角线表  /  公式标题  /  图片说明  /  表标题  /  多张图片  / 发现更多 插入组...

🔍 精准选择:精确定位 特定页面  /    /  形状  /  标题段落  / 增强导航功能 更多 选择功能...

星级增强: 快速导航至任何位置  /  自动插入重复文本  /  在文档窗口之间无缝切换  /  11 转换工具...

👉 想尝试这些功能吗? Kutools for Word 提供了 60-day免费试用,没有任何限制! 🚀
 
Comments (5)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Yeah nice try, but it should really put the enlarged image in a temporary popup, instead of literally resizing the image!
This comment was minimized by the moderator on the site
OK...after clicking to expand, how do you get it to restore back to default size or click to default size?
This comment was minimized by the moderator on the site
It work in older world file, saved as .doc, but opened in MS 365.
This comment was minimized by the moderator on the site
Hi

The macro doesn't work as should. On MS Office 365 the resizing appear only for few mili sec.
This comment was minimized by the moderator on the site
Hi Thanks for the tip. I'm following the instructions on how to enlarge by using Macro, however I'm getting a error message "The type that was defined by user was ot defined" Any idea?
There are no comments posted here yet
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations