Word.SaveConfiguration enum
保存オプションを指定します。
注釈
使用元
例
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/50-document/close-document-window.yaml
// Closes the active document window with Word's prompt-to-save option.
if (!Office.context.requirements.isSetSupported("WordApiDesktop", "1.4")) {
console.error("This sample requires WordApiDesktop 1.4 or later.");
return;
}
await Word.run(async (context) => {
const window: Word.Window = context.document.activeWindow;
const saveChanges: Word.SaveConfiguration = Word.SaveConfiguration.promptToSaveChanges;
const closeOptions: Word.WindowCloseOptions = { saveChanges };
console.log("About to close the document window...");
window.close(closeOptions);
await context.sync();
});
フィールド
| doNotSaveChanges = "DoNotSaveChanges" | 変更を保存しないことを指定します。 |
| promptToSaveChanges = "PromptToSaveChanges" | 変更を保存するためのプロンプトを指定するを指定します。 |
| saveChanges = "SaveChanges" | 変更を保存するように指定します。 |