Word.EditorType enum

表示可以编辑受保护 (只读) 文档的授权部分的用户类。

注解

API 集:WordApiDesktop 1.4

使用方

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/35-ranges/manage-range-editing-permissions-desktop.yaml

// Grants everyone permission to edit the first paragraph when editing restrictions apply.
await Word.run(async (context) => {
    const paragraphRange: Word.Range = context.document.body.paragraphs.getFirst().getRange(Word.RangeLocation.content);
    const editors: Word.EditorCollection = paragraphRange.editors;
    const editorType: Word.EditorType = Word.EditorType.everyone;
    const editor: Word.Editor = editors.addByType(editorType);
    await context.sync();
    console.log("Granted Everyone permission on the summary. Get editors to verify it.");
});

字段

current = "Current"

代表文档的当前用户。

editors = "Editors"

代表使用"信息版权管理"的文档的"编辑"组。

everyone = "Everyone"

代表打开文档的所有用户。

owners = "Owners"

代表使用"信息版权管理"的文档的"所有者"组。