跳到主要内容

GetDrawingsByPlaceholderType

按指定的占位符类型返回绘图数组。

语法

expression.GetDrawingsByPlaceholderType(sType);

expression - 表示 ApiMaster 类的变量。

参数

名称必需/可选数据类型默认值描述
sType必需PlaceholderType占位符类型。

返回值

Drawing[]

示例

此示例按占位符类型获取绘图并将其从幻灯片母版中删除。

// How to get all drawings as an array by indicating placeholder type from a master.

// Get drawings by their placeholder type knowing a slide master.

const presentation = Api.GetPresentation();
const slide = presentation.GetSlideByIndex(0);
const master = presentation.GetMaster(0);
const aDrawingsWithPh = master.GetDrawingsByPlaceholderType("title");
for (let i = 0; i < aDrawingsWithPh.length; i++) {
aDrawingsWithPh[i].Delete();
}