TextFrame Object (PowerPoint)
Published: July 16, 2012
Represents the text frame in a Shape object. Contains the text in the text frame and the properties and methods that control the alignment and anchoring of the text frame.
Use the TextFrame property to return a TextFrame object. The following example adds a rectangle to myDocument, adds text to the rectangle, and then 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 = 10 .MarginLeft = 10 .MarginRight = 10 .MarginTop = 10 End With