WPS 加载项开发 > 演示 API 参考 > ShapeRange > 属性 > ShapeRange.PlaceholderFormat 属性
返回一个 PlaceholderFormat 对象,该对象包含占位符特有的属性。只读。

语法

表达式.PlaceholderFormat

表达式   一个代表 ShapeRange 对象的变量。

返回值
PlaceholderFormat

示例

以下示例在当前演示文稿内第一张幻灯片的第一个占位符中添加文本(如果该占位符是水平标题占位符)。

示例代码
let phs = ActivePresentation.Slides.Item(1).Shapes.Placeholders

if(phs.Count > 0){
    switch(phs.Item(1).PlaceholderFormat.Type){
        case ppPlaceholderTitle:
            phs.Item(1).TextFrame.TextRange.Text = "Title Text"
            break
        case ppPlaceholderCenterTitle:
            phs.Item(1).TextFrame.TextRange.Text = "Centered Title Text"
            break
        default:
            MsgBox("There's no horizontal title on this slide")
    }
}


请参阅