Shape.InlineTextRange プロパティ (Publisher)

テキスト範囲の中でのインライン図形の位置を反映する TextRange オブジェクトを取得します。 値の取得のみ可能です。

構文

InlineTextRange

Shape オブジェクトを表す変数。

注釈

返されるテキスト範囲には、インライン図形を表す 1 つのオブジェクトが含まれています。 インライン図形以外に使用すると、オートメーション エラーになります。

次の例では、文書の最初のページで最初の図形 (テキスト ボックス) を検索し、テキスト ボックス内のテキスト範囲にインライン図形が含まれているかどうかを決定します。 インライン図形が見つかった場合、テキストのブロックを挿入した後は、インライン図形を表す、 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 のサポートおよびフィードバックを参照してください。