Publisher) (Shape.InlineTextRange 属性

返回 TextRange 对象,该对象反映嵌入形状在包含该形状的文字范围内的位置。 只读。

语法

表达式。InlineTextRange

expression 一个代表 Shape 对象的变量。

备注

返回的文本区域包含表示内联形状的单个对象。 如果形状尚未嵌入,则返回自动化错误。

示例

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

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

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。