InlineTextRange 属性 (Publisher)Shape.InlineTextRange property (Publisher)

返回 TextRange 对象,该对象反映嵌入形状在包含该形状的文字范围内的位置。Returns a TextRange object that reflects the position of the inline shape in its containing text range. 此为只读属性。Read-only.

语法Syntax

表达式InlineTextRangeexpression.InlineTextRange

_表达式_一个代表**Shape** 对象的变量。expression A variable that represents a Shape object.

说明Remarks

返回的文本范围包含一个代表嵌入形状的对象。The returned text range contains a single object representing the inline shape. 如果形状尚未嵌入,则返回自动化错误。An automation error is returned if the shape is not inline.

示例Example

下面的示例在出版物的第一页上查找第一个形状 (一个文本框),并确定该文本框内的文字范围是否包含嵌入形状。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. 如果找到内嵌形状, InlineTextRange 属性用于表示内嵌形状之后插入的文本块。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

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.