Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
Word.InsertLocation enum
- Package:
- word
Represents the insertion location type.
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.
Used by
- Word.CommentContentRange: insertText
- Word.Range: insertField, insertFileFromBase64, insertHtml, insertInlinePictureFromBase64, insertOoxml, insertText
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. |
Office Add-ins
Feedback
Was this page helpful?
