Dzwebs.Net

撰写电脑技术杂文十余年

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

Admin | 2013-9-28 17:23:51 | 被阅次数 | 6507

温馨提示!

如果未能解决您的问题,请点击搜索;登陆可复制文章,点击登陆

  一、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


该杂文来自: PowerPoint杂文

上一篇:Tags对象之VBA程序设计

下一篇:TextRange在演示文稿编程中的复杂使用

网站备案号:

网站备案号:滇ICP备11001339号-7

版权属性:

Copyright 2007-2021-forever Inc. all Rights Reserved.

联系方式:

Email:dzwebs@126.com QQ:83539231 访问统计