PlaceholderFormat 对象

         
Shapes (Shape)
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