jennychen 发表于 2017-10-12 11:15:30

TextEffectFormat设置艺术字,TextFrame代表文本框中的SHAPE对象

        一、TextEffectFormat对象
  包含应用于艺术字对象的属性和方法。
  使用 TextEffectFormat 对象
  使用 TextEffect 属性返回 TextEffectFormat 对象。以下示例为 myDocument 上的第一个形状设置字体名称及格式。要运行本示例,第一个形状必须是艺术字对象。
  Set myDocument = ActivePresentation.Slides(1)
  With myDocument.Shapes(1).TextEffect
   .FontName = "Courier New"
   .FontBold = True
   .FontItalic = True
  End With
  二、TextFrame对象
  代表 Shape 对象中的文字框。包含文本框中的文本,还包含控制文本框对齐方式和缩进方式的属性和方法。
  使用 TextFrame 对象
  使用 TextFrame 属性返回 TextFrame 对象。以下示例向 myDocument 中添加一个矩形,向矩形中添加文本,然后设置文本框的边距。
  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
  使用 HasTextFrame 属性决定形状是否含有文本框,使用 HasText 属性决定文本框是否含有文本,如以下示例所示。
  Set myDocument = ActivePresentation.Slides(1)
  For Each s In myDocument.Shapes
   If s.HasTextFrame Then
   With s.TextFrame
   If .HasText Then MsgBox .TextRange.Text
   End With
   End If
  Next

dreameagle 发表于 2017-10-13 11:36:46

说的不错

whole.秋 发表于 2017-10-17 18:01:53

嘿...反了反了,,,,
页: [1]
查看完整版本: TextEffectFormat设置艺术字,TextFrame代表文本框中的SHAPE对象