Table of contents
TOC
折叠目录
展开目录

TextRange2 对象 (PowerPoint)TextRange2 Object (PowerPoint)

office 365 dev account|上次更新日期: 2017/9/25
|
1 参与者

代表形状ShapeRange对象中的文字框架。Represents the text frame in a Shape or ShapeRange objects.

注解Remarks

此对象包含文本框中的文字框架,以及属性和控件的对齐方式和定位的文本框架的方法。TextFrame2属性用于返回TextFrame2对象。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

下面的示例向 myDocument 中添加一个矩形,向矩形中添加文本,然后设置文本框的边距。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 

另请参阅See also

概念Concepts

© 2018 Microsoft