Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Word.ShapeAutoSize enum
- Package:
- word
Determines the type of automatic sizing allowed.
Remarks
Used by
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/manage-shapes-text-boxes.yaml
await Word.run(async (context) => {
// Sets text frame properties of the first text box in the main document.
const shape: Word.Shape = context.document.body.shapes.getByTypes([Word.ShapeType.textBox]).getFirstOrNullObject();
shape.load("textFrame");
await context.sync();
if (shape.isNullObject) {
console.log("No shapes with text boxes found in the main document.");
return;
}
const textFrame: Word.TextFrame = shape.textFrame;
textFrame.verticalAlignment = Word.ShapeTextVerticalAlignment.bottom;
textFrame.orientation = Word.ShapeTextOrientation.vertical270;
textFrame.autoSizeSetting = Word.ShapeAutoSize.shapeToFitText;
console.log("The first text box's text frame properties were updated:", textFrame);
});
Fields
| mixed = "Mixed" | A combination of automatic sizing schemes are used. |
| none = "None" | No autosizing. |
| shapeToFitText = "ShapeToFitText" | The shape is adjusted to fit the text. |
| textToFitShape = "TextToFitShape" | The text is adjusted to fit the shape. |
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.
Office Add-ins
Feedback
Was this page helpful?
