ShapeRange.HasTextFrame プロパティ (PowerPoint)

指定した図形にテキストフレームが含まれているかどうかを示す値を取得します。 値の取得のみ可能です。

構文

HasTextFrame

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

戻り値

MsoTriState

注釈

HasTextFrame プロパティの値には、以下の msotristate クラス の定数のいずれかを指定できます。

定数 説明
msoFalse 指定した図形にはテキストフレームがないため、テキストを含めることができません。
msoTrue 指定した図形にはテキストフレームがあるため、テキストを含めることができます。

次の使用例は、スライド 1 のレイアウト枠を含むすべての図形の名前とテキストを表示します。

Dim shpTextArray() As Variant
Dim numShapes, numAutoShapes, i As Long

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes
    numShapes = .Count
    If numShapes > 1 Then
        numTextShapes = 0
        ReDim shpTextArray(1 To 2, 1 To numShapes)
        For i = 1 To numShapes
            If .Item(i).HasTextFrame Then
                numTextShapes = numTextShapes + 1
                shpTextArray(numTextShapes, 1) = .Item(i).Name
                shpTextArray(numTextShapes, 2) = .Item(i) _
                    .TextFrame.TextRange.Text
            End If
        Next
        ReDim Preserve shpTextArray(1 To 2, 1 To numTextShapes)
    End If
End With

関連項目

ShapeRange オブジェクト

サポートとフィードバック

Office VBA またはこの説明書に関するご質問やフィードバックがありますか? サポートの受け方およびフィードバックをお寄せいただく方法のガイダンスについては、Office VBA のサポートおよびフィードバックを参照してください。