Dzwebs.Net

撰写电脑技术杂文十余年

PlaceholderFormat、Placeholders实例

Admin | 2013-6-29 11:02:13 | 被阅次数 | 5298

温馨提示!

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

  一、PlaceholderFormat 对象

  包含专门应用于占位符的属性,例如占位符类型。

  使用 PlaceholderFormat 对象

  使用 PlaceholderFormat 属性返回 PlaceholderFormat 对象。如果当前演示文稿第一张幻灯片的第一个占位符存在并且是水平标题占位符,以下示例在该占位符中添加文本。

  With ActivePresentation.Slides(1).Shapes.Placeholders
      If .Count > 0 Then
          With .Item(1)
              Select Case .PlaceholderFormat.Type
                Case ppPlaceholderTitle
                    .TextFrame.TextRange = "Title Text"
                Case ppPlaceholderCenterTitle
                    .TextFrame.TextRange = "Centered Title Text"
                Case Else
                    MsgBox "There's no horizontal " _
                        "title on this slide"
            End Select
        End With
      End If
  End With

  二、Placeholders 集合对象

  代表指定幻灯片中占位符的所有 Shape 对象的集合。Placeholders 集合中的每个 Shape 对象代表一个占位符,占位符可以是文本、图表、表格、组织结构图或其他类型的对象。如果幻灯片有标题,则标题是集合中的第一个占位符。

  使用 Placeholders 集合

  使用 Placeholders 属性返回 Placeholders 集合。使用 Placeholders(index) 返回代表单个占位符的 Shape 对象,其中 index 是占位符索引号。请注意:任何标题为 Shapes.Title 的幻灯片等同于 Shapes.Placeholders(1)。以下示例向演示文稿的开头添加有具有项目符号列表的幻灯片版式,设置标题文本,然后向文本占位符中添加两个段落。

  Set sObj = ActivePresentation.Slides.Add(1, ppLayoutText).Shapes
  sObj.Title.TextFrame.TextRange.Text = "This is the title text"
  sObj.Placeholders(2).TextFrame.TextRange.Text = "Item 1" & Chr(13) & "Item 2"


该杂文来自: PowerPoint杂文

上一篇:ParagraphFormat 对象、PictureFormat 对象

下一篇:PlaySettings 对象、Presentation 对象

网站备案号:

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

版权属性:

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

联系方式:

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