TextFrame 属性

       

该属性返回一个 TextFrame 对象,该对象包含指定图形的文字。

示例

本示例在 myDocument 中添加一个矩形,在矩形中添加文本,并为文字框架添加边距。

Set myDocument = ActiveDocument
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