@@ -16657,6 +16657,78 @@ PowerPoint.ParagraphHorizontalAlignment:enum:
1665716657 });
1665816658 await context.sync();
1665916659 });
16660+ PowerPoint.PlaceholderFormat:class:
16661+ - >-
16662+ // Link to full sample:
16663+ https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml
16664+
16665+
16666+ // Gets the placeholder shapes in the slide.
16667+
16668+ await PowerPoint.run(async (context) => {
16669+ // Get properties for every shape in the collection.
16670+ const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
16671+ shapes.load("type,name");
16672+ await context.sync();
16673+
16674+ const placeholderShapes = [];
16675+ console.log(`Number of shapes found: ${shapes.items.length}`);
16676+ shapes.items.forEach((shape) => {
16677+ if (shape.type === PowerPoint.ShapeType.placeholder) {
16678+ // Load placeholderFormat property.
16679+ // PowerPoint throws an exception if you try to load this property on a shape that isn't a placeholder type.
16680+ shape.load("placeholderFormat");
16681+ placeholderShapes.push(shape);
16682+ }
16683+ });
16684+ await context.sync();
16685+
16686+ console.log(`Number of placeholder shapes found: ${placeholderShapes.length}`);
16687+ for (let i = 0; i < placeholderShapes.length; i++) {
16688+ let currentPlaceholder: PowerPoint.PlaceholderFormat = placeholderShapes[i].placeholderFormat;
16689+ let placeholderType = currentPlaceholder.type as PowerPoint.PlaceholderType;
16690+ let placeholderContainedType = currentPlaceholder.containedType as PowerPoint.ShapeType;
16691+ console.log(`Shape "${placeholderShapes[i].name}" placeholder properties:`);
16692+ console.log(`\ttype: ${placeholderType}`);
16693+ console.log(`\tcontainedType: ${placeholderContainedType}`);
16694+ }
16695+ });
16696+ PowerPoint.PlaceholderType:enum:
16697+ - >-
16698+ // Link to full sample:
16699+ https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml
16700+
16701+
16702+ // Gets the placeholder shapes in the slide.
16703+
16704+ await PowerPoint.run(async (context) => {
16705+ // Get properties for every shape in the collection.
16706+ const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
16707+ shapes.load("type,name");
16708+ await context.sync();
16709+
16710+ const placeholderShapes = [];
16711+ console.log(`Number of shapes found: ${shapes.items.length}`);
16712+ shapes.items.forEach((shape) => {
16713+ if (shape.type === PowerPoint.ShapeType.placeholder) {
16714+ // Load placeholderFormat property.
16715+ // PowerPoint throws an exception if you try to load this property on a shape that isn't a placeholder type.
16716+ shape.load("placeholderFormat");
16717+ placeholderShapes.push(shape);
16718+ }
16719+ });
16720+ await context.sync();
16721+
16722+ console.log(`Number of placeholder shapes found: ${placeholderShapes.length}`);
16723+ for (let i = 0; i < placeholderShapes.length; i++) {
16724+ let currentPlaceholder: PowerPoint.PlaceholderFormat = placeholderShapes[i].placeholderFormat;
16725+ let placeholderType = currentPlaceholder.type as PowerPoint.PlaceholderType;
16726+ let placeholderContainedType = currentPlaceholder.containedType as PowerPoint.ShapeType;
16727+ console.log(`Shape "${placeholderShapes[i].name}" placeholder properties:`);
16728+ console.log(`\ttype: ${placeholderType}`);
16729+ console.log(`\tcontainedType: ${placeholderContainedType}`);
16730+ }
16731+ });
1666016732PowerPoint.Presentation:class:
1666116733 - >-
1666216734 // Link to full sample:
@@ -17219,6 +17291,42 @@ PowerPoint.Shape#left:member:
1721917291 currentLeft = 0;
1722017292 if (currentTop > slideHeight - 200) currentTop = 0;
1722117293 });
17294+ PowerPoint.Shape#placeholderFormat:member:
17295+ - >-
17296+ // Link to full sample:
17297+ https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/get-shapes-by-type.yaml
17298+
17299+
17300+ // Gets the placeholder shapes in the slide.
17301+
17302+ await PowerPoint.run(async (context) => {
17303+ // Get properties for every shape in the collection.
17304+ const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
17305+ shapes.load("type,name");
17306+ await context.sync();
17307+
17308+ const placeholderShapes = [];
17309+ console.log(`Number of shapes found: ${shapes.items.length}`);
17310+ shapes.items.forEach((shape) => {
17311+ if (shape.type === PowerPoint.ShapeType.placeholder) {
17312+ // Load placeholderFormat property.
17313+ // PowerPoint throws an exception if you try to load this property on a shape that isn't a placeholder type.
17314+ shape.load("placeholderFormat");
17315+ placeholderShapes.push(shape);
17316+ }
17317+ });
17318+ await context.sync();
17319+
17320+ console.log(`Number of placeholder shapes found: ${placeholderShapes.length}`);
17321+ for (let i = 0; i < placeholderShapes.length; i++) {
17322+ let currentPlaceholder: PowerPoint.PlaceholderFormat = placeholderShapes[i].placeholderFormat;
17323+ let placeholderType = currentPlaceholder.type as PowerPoint.PlaceholderType;
17324+ let placeholderContainedType = currentPlaceholder.containedType as PowerPoint.ShapeType;
17325+ console.log(`Shape "${placeholderShapes[i].name}" placeholder properties:`);
17326+ console.log(`\ttype: ${placeholderType}`);
17327+ console.log(`\tcontainedType: ${placeholderContainedType}`);
17328+ }
17329+ });
1722217330PowerPoint.Shape#top:member:
1722317331 - >-
1722417332 // Link to full sample:
0 commit comments