Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Word.RelativeVerticalPosition enum
- Package:
- word
Represents what the vertical position of a shape is relative to. For more information about margins, see Change the margins in your Word document.
Remarks
Used by
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/group-ungroup.yaml
await Word.run(async (context) => {
// Changes the position of the first set of grouped shapes (including text boxes) found in the document body.
const firstShapeGroup: Word.Shape = context.document.body.shapes
.getByTypes([Word.ShapeType.group])
.getFirstOrNullObject();
firstShapeGroup.load("shapeGroup/shapes");
await context.sync();
if (firstShapeGroup.isNullObject) {
console.log("No shape groups found in the document body.");
return;
}
let shapeGroup: Word.ShapeGroup = firstShapeGroup.shapeGroup;
console.log("About to change the position of the first shape group found in document body:", shapeGroup.shapes);
firstShapeGroup.relativeVerticalPosition = Word.RelativeVerticalPosition.insideMargin;
firstShapeGroup.relativeHorizontalPosition = Word.RelativeHorizontalPosition.margin;
console.log("Changed the position of the first shape group.");
});
Fields
| bottomMargin = "BottomMargin" | Relative to bottom margin. |
| insideMargin = "InsideMargin" | Relative to inside margin. |
| line = "Line" | Relative to line. |
| margin = "Margin" | Relative to margin. |
| outsideMargin = "OutsideMargin" | Relative to outside margin. |
| page = "Page" | Relative to page. |
| paragraph = "Paragraph" | Relative to paragraph. |
| topMargin = "TopMargin" | Relative to top margin. |
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?
