Word.InsertLocation enum
The insertion location types.
Remarks
To be used with an API call, such as obj.insertSomething(newStuff, location);
. If the location is "Before" or "After", the new content will be outside of the modified object. If the location is "Start" or "End", the new content will be included as part of the modified object.
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/insert-section-breaks.yaml
// Inserts a section without an associated page break.
await Word.run(async (context) => {
const body: Word.Body = context.document.body;
body.insertBreak(Word.BreakType.sectionContinuous, Word.InsertLocation.end);
await context.sync();
console.log("Inserted section without an associated page break.");
});
Fields
after = "After" | Add content after the contents of the calling object. |
before = "Before" | Add content before the contents of the calling object. |
end = "End" | Append content to the contents of the calling object. |
replace = "Replace" | Replace the contents of the current object. |
start = "Start" | Prepend content to the contents of the calling object. |
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