Table of contents
Collapse the table of content
Expand the table of content

TextRange.InlineShapes Property (Publisher)

office 365 dev account|Last Updated: 8/24/2017
3 Contributors

Returns an InlineShapes collection, which represents the inline shapes contained within a text range. Read-only.


expression. InlineShapes

_expression_A variable that represents an TextRange object.

Return Value



Using TextFrame.Story.TextRange.InlineShapes will return all inline shapes in a text frame, including those that are in overflow. Using TextFrame.TextRange.InlineShapes will return only visible inline shapes in a text frame, and not those that are in overflow.


The following example finds the first shape (a text box) on page one of the active publication. The InlineShapes property is then used to determine whether any inline shapes exist in the text box. If any are found, each inline shape is flipped vertically, and its fore color is set to red.

Note that by using TextFrame.Story.TextRange.InlineShapes, any inline shapes that are in overflow will also be found.

Dim theShape As Shape 
Dim i As Integer 

Set theShape = ActiveDocument.Pages(1).Shapes(1) 

With theShape.TextFrame.Story.TextRange 
 If .InlineShapes.Count > 0 Then 
 For i = 1 To .InlineShapes.Count 
 .InlineShapes(i).Flip (msoFlipVertical) 
 .InlineShapes(i).Fill.ForeColor.RGB = vbRed 
 End If 
End With
© 2018 Microsoft