Word.InsertLocation enum
The insertion location types.
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.
// 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.");
});
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. |
Office Add-ins feedback
Office Add-ins is an open source project. Select a link to provide feedback: