PowerPoint.PlaceholderType enum
プレースホルダーの型を指定します。
注釈
[ API セット: PowerPointApi 1.8 ]
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml
// Gets the placeholder shapes in the slide.
await PowerPoint.run(async (context) => {
// Get properties for every shape in the collection.
const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
shapes.load("type,name");
await context.sync();
const placeholderShapes = [];
console.log(`Number of shapes found: ${shapes.items.length}`);
shapes.items.forEach((shape) => {
if (shape.type === PowerPoint.ShapeType.placeholder) {
// Load placeholderFormat property.
// PowerPoint throws an exception if you try to load this property on a shape that isn't a placeholder type.
shape.load("placeholderFormat");
placeholderShapes.push(shape);
}
});
await context.sync();
console.log(`Number of placeholder shapes found: ${placeholderShapes.length}`);
for (let i = 0; i < placeholderShapes.length; i++) {
let currentPlaceholder: PowerPoint.PlaceholderFormat = placeholderShapes[i].placeholderFormat;
let placeholderType = currentPlaceholder.type as PowerPoint.PlaceholderType;
let placeholderContainedType = currentPlaceholder.containedType as PowerPoint.ShapeType;
console.log(`Shape "${placeholderShapes[i].name}" placeholder properties:`);
console.log(`\ttype: ${placeholderType}`);
console.log(`\tcontainedType: ${placeholderContainedType}`);
}
});
フィールド
| body = "Body" | プレースホルダーは本文用です。 |
| cameo = "Cameo" | プレースホルダーはカメオ用です。 |
| centerTitle = "CenterTitle" | プレースホルダーはセンター タイトル用です。 |
| chart = "Chart" | プレースホルダーはグラフ用です。 |
| content = "Content" | プレースホルダーは汎用コンテンツ用です。 |
| date = "Date" | プレースホルダーは日付用です。 |
| footer = "Footer" | プレースホルダーはフッター用です。 |
| header = "Header" | プレースホルダーはヘッダー用です。 |
| media = "Media" | プレースホルダーはメディア用です。 |
| onlinePicture = "OnlinePicture" | プレースホルダーはオンライン画像用です。 |
| picture = "Picture" | プレースホルダーは画像用です。 |
| slideNumber = "SlideNumber" | プレースホルダーはスライド番号用です。 |
| smartArt = "SmartArt" | プレースホルダーは SmartArt 用です。 |
| subtitle = "Subtitle" | プレースホルダーはサブタイトル用です。 |
| table = "Table" | プレースホルダーはテーブル用です。 |
| title = "Title" | プレースホルダーはタイトル用です。 |
| unsupported = "Unsupported" | プレースホルダーはサポートされていません。 |
| verticalBody = "VerticalBody" | プレースホルダーは垂直方向の本文用です。 |
| verticalContent = "VerticalContent" | プレースホルダーは、一般的な垂直コンテンツ用です。 |
| verticalTitle = "VerticalTitle" | プレースホルダーは垂直タイトル用です。 |