Shape.InlineTextRange property (Publisher)
Returns a TextRange object that reflects the position of the inline shape in its containing text range. Read-only.
expression A variable that represents a Shape object.
The returned text range contains a single object representing the inline shape. An automation error is returned if the shape is not inline.
The following example finds the first shape (a text box) on the first page of the publication, and determines if the text range within the text box contains inline shapes. If inline shapes are found, the InlineTextRange property is used to represent the inline shape after a block of text is inserted.
Dim theShape As Shape Dim theTextRange As TextRange Dim i As Integer Set theShape = ActiveDocument.Pages(1).Shapes(1) If Not theShape.IsInline = True Then With theShape.TextFrame.Story.TextRange If .InlineShapes.Count > 0 Then Set theTextRange = theShape.TextFrame.Story.TextRange For i = 1 To .InlineShapes.Count With .InlineShapes(i) .InlineTextRange.InsertAfter (" (Figure " & i & ") ") End With Next End If End With End If
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.