Word.InsertShapeOptions interface
Specifies the options to determine location and size when inserting a shape.
Remarks
[ API set: WordApiDesktop 1.2 ]
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/manage-shapes-text-boxes.yaml
await Word.run(async (context) => {
// Inserts a text box at the beginning of the selection.
const range: Word.Range = context.document.getSelection();
const insertShapeOptions: Word.InsertShapeOptions = {
top: 0,
left: 0,
height: 100,
width: 100
};
const newTextBox: Word.Shape = range.insertTextBox("placeholder text", insertShapeOptions);
await context.sync();
console.log("Inserted a text box at the beginning of the current selection.");
});
Properties
height | Represents the height of the shape being inserted. |
left | Represents the left position of the shape being inserted. |
top | Represents the top position of the shape being inserted. |
width | Represents the width of the shape being inserted. |
Property Details
height
Represents the height of the shape being inserted.
height?: number;
Property Value
number
Remarks
left
Represents the left position of the shape being inserted.
left?: number;
Property Value
number
Remarks
top
Represents the top position of the shape being inserted.
top?: number;
Property Value
number
Remarks
width
Represents the width of the shape being inserted.
width?: number;
Property Value
number