Skip to content

Latest commit

 

History

History
72 lines (52 loc) · 2.13 KB

Excel.TextFrame2.md

File metadata and controls

72 lines (52 loc) · 2.13 KB
title api_name ms.assetid ms.date ms.localizationpriority
TextFrame2 object (Excel)
Excel.TextFrame2
66ba23e5-9b15-b954-a1db-1bd19b4eb90d
04/02/2019
medium

TextFrame2 object (Excel)

Represents the text frame in a Shape, ShapeRange, or ChartFormat object.

Remarks

This object contains the text in the text frame as well as the properties and methods that control the alignment and anchoring of the text frame. Use the TextFrame2 property to return a TextFrame2 object.

Example

The following example adds a rectangle to myDocument, adds text to the rectangle, and then sets the margins for the text frame.

Set myDocument = Worksheets(1) 
With myDocument.Shapes.AddShape(msoShapeRectangle, _ 
 0, 0, 250, 140).TextFrame2 
 .TextRange.Text = "Here is some test text" 
 .MarginBottom = 10 
 .MarginLeft = 10 
 .MarginRight = 10 
 .MarginTop = 10 
End With

Methods

Properties

See also

[!includeSupport and feedback]