Shape.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.