How to convert all linked images to embedded in Word document?
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.
Convert linked images to embedded with VBA code
Convert linked images to embedded with VBA code
Please apply the below VBA code to convert all linked images in a document to embedded.
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.
2. In the Microsoft Visual Basic for Applications window, click Insert > Module. And then copy below VBA code into the Module window. See screenshot:
VBA code: Convert all linked images to embedded at once
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.
Then all linked images in current document are converted to embedded ones at the same time.
Recommended Word Productivity Tools
Kutools For Word - More Than 100 Advanced Features For Word, Save Your 50% Time
- Complicated and repeated operations can be done one-time processing in seconds.
- Insert multiple images across folders into Word document at once.
- Merge and combine multiple Word files across folders into one with your desired order.
- Split the current document into separate documents according to heading, section break or other criteria.
- Convert files between Doc and Docx, Docx and PDF, collection of tools for common conversions and selection, and so on...