TextFrame Property

Applies To

Shape object, ShapeRange collection object, TextStyle object.

Description

Returns a TextFrame object that contains the alignment and anchoring properties for the specified shape or master text style.

Remarks

Use the TextRange property of the TextFrame object to return the text in the text frame.

Use the HasTextFrame property to determine whether a shape contains a text frame before you apply the TextFrame property.

See Also

Text property, TextRange property.

Example

This example adds a rectangle to myDocument, adds text to the rectangle, and sets the margins for the text frame.

Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.AddShape(msoShapeRectangle, 0, 0, 250, 140) _
    .TextFrame
    .TextRange.Text = "Here is some test text"
    .MarginBottom = 0
    .MarginLeft = 100
    .MarginRight = 0
    .MarginTop = 20
End With