返回一个 TextFrame 对象,该对象包含指定形状或母版文本样式的对齐方式和固定属性。
使用 TextFrame 对象的 TextRange 属性返回文本框中的文本。
使用 HasTextFrame 属性前,请用 HasTextFsTextFrame 属性决定形状中是否包含文本框。
本示例在 myDocument
中添加一个矩形,并向矩形中添加文本,然后设置文本框的上边距。
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes _
.AddShape(msoShapeRectangle, 180, 175, 350, 140).TextFrame
.TextRange.Text = "Here is some test text"
.MarginTop = 10
End With