TextRange.InlineShapes property (Publisher)

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

Syntax

expression.InlineShapes

expression A variable that represents a TextRange object.

Return value

InlineShapes

Remarks

Using TextFrame.Story.TextRange.InlineShapes returns all inline shapes in a text frame, including those that are in overflow.

Using TextFrame.TextRange.InlineShapes returns only visible inline shapes in a text frame, and not those that are in overflow.

Example

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 
 Next 
 End If 
End With

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.