logo
search
VBA & Macro Problems

How to Convert Linked Inline Pictures to Shapes using Word VBA

Maira MehtabMaira Mehtab Sep 21, 2026 869 views

Question details

The user needs to convert an InlineShape of type wdInlineShapeLinkedPicture into a floating Shape using Word VBA, but the ConvertToShape method fails or does not apply text wrapping correctly.

Product
Microsoft Word
Device & OS
not provided
Scenario
Using a Word VBA macro to automate the conversion of images inserted via the INCLUDEPICTURE field from inline layouts to floating shapes with specific text wrapping.
Observed behavior
The ConvertToShape method successfully converts standard embedded pictures but fails or behaves unexpectedly when applied to linked inline pictures.
Before you start

Always run and test your VBA macro changes on a duplicate copy of your Word document to prevent accidental formatting corruption or data loss.

Solution 1Recommended

Embed the Linked Picture Before Conversion

Since wdInlineShapeLinkedPicture objects do not fully support the ConvertToShape method, unlinking and embedding the picture first allows the VBA method to work as expected.

Linked pictures inserted via the INCLUDEPICTURE field handle text wrapping differently than standard embedded images. Word VBA's ConvertToShape method natively expects an embedded wdInlineShape object to correctly apply floating text wrap styles like Square, Tight, or Behind Text.

1
Unlink the Picture Manually or via VBA

Select the linked picture in your Word document and press 'Ctrl + Shift + F9' to break the link and embed the picture directly into the document. Alternatively, use 'ActiveDocument.Fields.Unlink' in your macro.

2
Target the Embedded InlineShape

Ensure your VBA code now targets the newly embedded InlineShape object instead of the linked picture.

3
Apply the ConvertToShape Method

Run 'InlineShape.ConvertToShape' in your macro to successfully convert the embedded image into a floating Shape.

4
Set the Text Wrapping Style

Use the 'Shape.WrapFormat.Type' property in your VBA script to apply the desired wrapping style, such as 'wdWrapSquare' or 'wdWrapBehind'.

Text Wrapping Options: Floating shapes require a defined wrap type. Ensure your macro specifies an explicit wrap style immediately after executing the ConvertToShape method.
Free Microsoft Office alternative

Try WPS Office for Seamless Document and Image Formatting

If you are tired of dealing with complex VBA errors and text wrapping restrictions in Word, WPS Office provides an intuitive interface for handling document layouts, floating shapes, and macros—completely free and highly compatible with Microsoft Office formats.

  1. 1. Download WPS Office: Visit the official WPS website and download the free WPS Office suite.
  2. 2. Open your Word Document: Launch WPS Writer and open your existing .docx file containing the macros and pictures.
  3. 3. Adjust Picture Layouts Easily: Click on any image and use the intuitive Layout Options menu to instantly change text wrapping to Square, Tight, or Behind Text without needing VBA.
Free, lightweight, and easy to installFully compatible with Microsoft Word documents (.docx) and embedded macrosIntuitive drag-and-drop interface for picture text wrappingAdvanced image editing and layout control without requiring complex VBA code
microsoft office alternative - wps office

Frequently Asked Questions

Why does Word VBA ConvertToShape fail on linked pictures?

The ConvertToShape method struggles with wdInlineShapeLinkedPicture objects because they rely on external file links (like the INCLUDEPICTURE field) rather than embedded document data, making it difficult for Word to assign a floating geometry layer.

How do I check if an InlineShape is a linked picture using VBA?

You can check the Type property of the InlineShape object. If 'InlineShape.Type = wdInlineShapeLinkedPicture', the image is linked rather than fully embedded.

What text wrapping styles are available for floating shapes in VBA?

Once an image is converted to a Shape, you can set its WrapFormat.Type to several constants, including wdWrapSquare, wdWrapTight, wdWrapThrough, wdWrapTopBottom, wdWrapBehind, and wdWrapFront.

Can I bulk convert all linked pictures to embedded pictures using VBA?

Yes, you can loop through the Fields collection in your ActiveDocument, find fields of type wdFieldIncludePicture, and use the '.Unlink' method to convert them into embedded pictures before running ConvertToShape.