@@ -27483,7 +27483,7 @@ Word.Range#insertGeometricShape:member(1):
2748327483 selection.insertGeometricShape(Word.GeometricShapeType.moon, shapeOptions);
2748427484 await context.sync();
2748527485
27486- console.log("Inserted a heptagon .");
27486+ console.log("Inserted a moon .");
2748727487 });
2748827488Word.Range#insertTextBox:member(1):
2748927489 - >-
@@ -27986,6 +27986,34 @@ Word.Shape#body:member:
2798627986
2798727987 console.log("New content control properties:", newControl);
2798827988 });
27989+ Word.Shape#fill:member:
27990+ - >-
27991+ // Link to full sample:
27992+ https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/manage-geometric-shapes.yaml
27993+
27994+
27995+ await Word.run(async (context) => {
27996+ // Gets the color fill properties of the first moon found in the document body.
27997+ const moon: Word.Shape = context.document.body.shapes
27998+ .getByGeometricTypes([Word.GeometricShapeType.moon])
27999+ .getFirstOrNullObject();
28000+ moon.load("fill");
28001+ await context.sync();
28002+
28003+ if (moon.isNullObject) {
28004+ console.log("No moons found in the document body.");
28005+ return;
28006+ }
28007+
28008+ const moonFill: Word.ShapeFill = moon.fill;
28009+ const moonFillType = moonFill.type as Word.ShapeFillType;
28010+
28011+ console.log("Color fill properties of the first moon found in the document body:");
28012+ console.log(`\tForeground color: ${moonFill.foregroundColor}`);
28013+ console.log(`\tBackground color: ${moonFill.backgroundColor}`);
28014+ console.log(`\tTransparency: ${moonFill.transparency}`);
28015+ console.log(`\tFill type: ${moonFillType}`);
28016+ });
2798928017Word.Shape#geometricShapeType:member:
2799028018 - >-
2799128019 // Link to full sample:
@@ -28196,6 +28224,62 @@ Word.ShapeCollection#getFirstOrNullObject:member(1):
2819628224 : `Text in first text box: ${shape.body.text}`
2819728225 );
2819828226 });
28227+ Word.ShapeFill:class:
28228+ - >-
28229+ // Link to full sample:
28230+ https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/manage-geometric-shapes.yaml
28231+
28232+
28233+ await Word.run(async (context) => {
28234+ // Gets the color fill properties of the first moon found in the document body.
28235+ const moon: Word.Shape = context.document.body.shapes
28236+ .getByGeometricTypes([Word.GeometricShapeType.moon])
28237+ .getFirstOrNullObject();
28238+ moon.load("fill");
28239+ await context.sync();
28240+
28241+ if (moon.isNullObject) {
28242+ console.log("No moons found in the document body.");
28243+ return;
28244+ }
28245+
28246+ const moonFill: Word.ShapeFill = moon.fill;
28247+ const moonFillType = moonFill.type as Word.ShapeFillType;
28248+
28249+ console.log("Color fill properties of the first moon found in the document body:");
28250+ console.log(`\tForeground color: ${moonFill.foregroundColor}`);
28251+ console.log(`\tBackground color: ${moonFill.backgroundColor}`);
28252+ console.log(`\tTransparency: ${moonFill.transparency}`);
28253+ console.log(`\tFill type: ${moonFillType}`);
28254+ });
28255+ Word.ShapeFillType:enum:
28256+ - >-
28257+ // Link to full sample:
28258+ https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/manage-geometric-shapes.yaml
28259+
28260+
28261+ await Word.run(async (context) => {
28262+ // Gets the color fill properties of the first moon found in the document body.
28263+ const moon: Word.Shape = context.document.body.shapes
28264+ .getByGeometricTypes([Word.GeometricShapeType.moon])
28265+ .getFirstOrNullObject();
28266+ moon.load("fill");
28267+ await context.sync();
28268+
28269+ if (moon.isNullObject) {
28270+ console.log("No moons found in the document body.");
28271+ return;
28272+ }
28273+
28274+ const moonFill: Word.ShapeFill = moon.fill;
28275+ const moonFillType = moonFill.type as Word.ShapeFillType;
28276+
28277+ console.log("Color fill properties of the first moon found in the document body:");
28278+ console.log(`\tForeground color: ${moonFill.foregroundColor}`);
28279+ console.log(`\tBackground color: ${moonFill.backgroundColor}`);
28280+ console.log(`\tTransparency: ${moonFill.transparency}`);
28281+ console.log(`\tFill type: ${moonFillType}`);
28282+ });
2819928283Word.ShapeTextOrientation:enum:
2820028284 - >-
2820128285 // Link to full sample:
0 commit comments