[转]如何在word中将链接图像转换为嵌入图像?How to convert all linked images to embedded in Word document?
原帖地址:https://www.extendoffice.com/documents/word/5423-word-convert-linked-image-to-embedded.html
How to convert all linked images to embedded in Word document?
如何在word中将链接图像转换为嵌入图像?
When you send a Word document contains linked images to others, the images will be missing and displayed in recipient’s computer as below screenshot shown. How to convert all linked images to embedded at once before sending to others? This article provides a VBA method to deal with it.
当将包含链接图像的word文档分发给他人时,在接收者的电脑上图像会丢失,并显示如下截图所示的占位信息。如何在发送文档之前将链接图像转为嵌入图像呢?本文采用一种VBA方法解决。
Convert linked images to embedded with VBA code
Convert linked images to embedded with VBA code
使用VBA将链接图像转换为嵌入图像
Please apply the below VBA code to convert all linked images in a document to embedded.
在文档中,使用以下VBA代码将链接图像转为嵌入图像
1. Open the Word document contains linked images you will convert to embedded images. Press the Alt + F11 keys to open the Microsoft Visual Basic for Applications window.
1.打开要转换的包含链接图像的word文档。按Alt+F11打开VBA编辑器。
2. In the Microsoft Visual Basic for Applications window, click Insert > Module. And then copy below VBA code into the Module window. See screenshot:
2.在VBA编辑器窗口,点击“插入-模块”。将下面的VBA代码复制到模块窗口内(如下截图):
VBA code: Convert all linked images to embedded at once
1
2
3
4
5
6
7
8
9
10
11
12
|
Sub convert_all_inline_shapes() 'Updated by Extendoffice 20180906 Dim xIShape As InlineShape For Each xIShape In ActiveDocument.InlineShapes With xIShape If .Type = wdInlineShapeLinkedPicture Then .LinkFormat.SavePictureWithDocument = True .LinkFormat.BreakLink End If End With Next End Sub |
3. Press the F5 key to run the code.
3.按F5运行代码。
Then all linked images in current document are converted to embedded ones at the same time.
然后文档中的所有链接图片就会一同被转换为嵌入图片。