跳到主要內容

如何單擊以放大或展開Word文檔中的圖像?

本文討論的是如何通過單擊鼠標來放大或展開Word文檔中的圖像。

單擊以使用VBA代碼放大或擴展圖像

使用Kutools for Word調整圖像大小


單擊以使用VBA代碼放大或擴展圖像

下面的VBA代碼可以幫助您通過單擊放大Word文檔中的圖像。 請執行以下操作。

1.在包含要單擊放大的圖像中,按 其他 + F11 鍵打開 Microsoft Visual Basic for Applications 窗口。

2。 在裡面 Microsoft Visual Basic for Applications 窗口中,單擊 插入 > 類模塊。 然後將下面的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 for Applications 窗口。

現在,單擊此文件中的圖像時,圖像將根據需要放大到特定大小。


使用Kutools for Word調整圖像大小

調整圖像大小 的效用 Kutools for Word 可以幫助您按指定百分比或所選圖像調整所有圖像的大小。 請嘗試一下。

Kutools for Word :擁有100多個方便的Word加載項, 免費試用,不受限制 60.

點擊 Kutools 加 > 調整大小,從下拉列表中選擇一個百分比。 看截圖:

然後,根據此特定百分比調整當前文檔中的所有圖像的大小。

要根據所選圖片的尺寸調整所有圖像的大小,需要先選擇圖像,然後單擊 Kutools 加 > 調整大小 > 通過選擇調整圖像大小。 看截圖:

然後,根據選定的圖像調整當前文檔中的所有圖像大小。

如果您想免費試用該實用程序,請轉到 免費下載軟件 首先,然後按照上述步驟進行操作。


Office Tab -Word中多個文檔的選項卡式瀏覽,編輯和管理:

Office選項卡將選項卡式界面帶到Microsoft Word中的Web瀏覽器(如Google Chrome,Internet Explorer新版本和Firefox)中。 它 成為省時的工具,在您的工作中無可替代。 參見下面的演示:

單擊免費試用Office選項卡!

最佳辦公生產力工具

Kutools for Word - 透過 Over 提升您的文字體驗 100 顯著特點!

🤖 Kutools 人工智慧助手:用人工智慧改變你的寫作 - 生成內容  /  重寫文字  /  總結文件  /  查詢資料 基於文檔,全部在Word中

📘 文件掌握: 分頁  /  合併文件  /  以各種格式匯出選擇(PDF/TXT/DOC/HTML...)  /  批次轉換為PDF  /  將頁面匯出為圖像  /  一次列印多個文件...

內容編輯: 批量查找和替換 跨多個文件  /  調整所有圖片的大小  /  轉置表行和列  /  將表格轉換為文字...

🧹 輕鬆清潔: 移開 多餘的空間  /  分節符  /  所有標題  /  文本框  /  超鏈接  / 如需更多拆卸工具,請前往我們的 刪除組...

創意插入: 插入 千位分隔符  /  複選框  /  單選按鈕  /  QR Code  /  條碼  /  對角線表  /  公式標題  /  圖片說明  /  表格標題  /  多張圖片  / 發現更多 插入組...

🔍 精準選擇:精確定位 特定頁面  /    /  形狀  /  標題段落  / 增強導航功能 更多 選擇功能...

星級增強: 快速導航至任何位置  /  自動插入重複文字  /  在文檔視窗之間無縫切換  /  11 轉換工具...

???? 想嘗試這些功能嗎? Kutools for Word 提供了 60天免費試用,沒有任何限制! 🚀
 
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