Word.AutoMacro enum

指示可在 Word 中自动运行的自动宏。

注解

API 集:WordApiDesktop 1.4

使用方

示例

await Word.run(async (context) => {
    const wordDocument: Word.Document = context.document;
    const autoMacro: Word.AutoMacro = Word.AutoMacro.open;
    wordDocument.runAutoMacro(autoMacro);
    await context.sync();

    console.log("Requested the AutoOpen macro.");
});

字段

close = "Close"

指示关闭文档时宏自动运行。

exit = "Exit"

指示在保存文档时宏自动运行。

new = "New"

指示在创建新文档时宏自动运行。

open = "Open"

指示打开文档时宏自动运行。

startWord = "StartWord"

指示 Word 启动时宏自动运行。

sync = "Sync"

指示同步文档时宏自动运行。