Word.SaveBehavior enum
Specifies the save behavior for Document.save
.
Remarks
Examples
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/save-close.yaml
// If the document hasn't been saved before, prompts
// user with options for if or how they want to save.
await Word.run(async (context) => {
context.document.save(Word.SaveBehavior.prompt);
await context.sync();
});
Fields
prompt = "Prompt" | Displays the "Save As" dialog to the user if the document hasn't been saved. Won't take effect if the document was previously saved. |
save = "Save" | Saves the document without prompting the user. If it's a new document, it will be saved with the default name or specified name in the default location. |
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