Word.ShapeTextOrientation enum
Specifies the orientation for the text frame in a shape.
Remarks
[ API set: WordApiDesktop 1.2 ]
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 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
| eastAsianHorizontalRotated = "EastAsianHorizontalRotated" | A special version of vertical text, where some fonts are displayed as if rotated. |
| eastAsianVertical = "EastAsianVertical" | A special version of vertical text, where some fonts are displayed as if rotated. |
| horizontal = "Horizontal" | Horizontal text. |
| mixed = "Mixed" | A combination of automatic orientation is used. |
| none = "None" | No orientation, such as in a new geometric shape. |
| vertical = "Vertical" | Determines if all of the text is vertical orientation (each line is 90 degrees rotated clockwise). |
| vertical270 = "Vertical270" | Determines if all of the text is vertical orientation (each line is 270 degrees rotated clockwise). |