TextFrame オブジェクト (PowerPoint)

Shape オブジェクトのレイアウト枠を表します。 Shape オブジェクトには、レイアウト枠のテキスト、およびレイアウト枠の配置や向きを制御するプロパティやメソッドが含まれます。

TextFrame オブジェクトを取得するには、TextFrame プロパティを使用します。 次の使用例は、myDocument に四角形を追加し、その四角形にテキストを追加し、次に、レイアウト枠に余白を設定します。

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes _

        .AddShape(msoShapeRectangle, 0, 0, 250, 140).TextFrame

    .TextRange.Text = "Here is some test text"

    .MarginBottom = 10

    .MarginLeft = 10

    .MarginRight = 10

    .MarginTop = 10

End With

次の例に示すように、 HasTextFrameプロパティを使用して図形にテキスト フレームがあるかどうかを判断し、 HasTextプロパティを使用してテキスト フレームにテキストが含まれているかどうかを判断します。

Set myDocument = ActivePresentation.Slides(1)

For Each s In myDocument.Shapes

    If s.HasTextFrame Then

        With s.TextFrame

            If .HasText Then MsgBox .TextRange.Text

        End With

    End If

Next

メソッド

名前
DeleteText

プロパティ

名前
アプリケーション
AutoSize
Creator
HasText
HorizontalAnchor
MarginBottom
MarginLeft
MarginRight
MarginTop
Orientation
Parent
Ruler
TextRange
VerticalAnchor
WordWrap

関連項目

PowerPoint Object Model Reference

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

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