Word.ApplyQuickStyleSet enum

指定要应用于文档的快速样式集。

注解

API 集:WordApiDesktop 1.4

使用方

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/28-formatting/apply-quick-style-sets.yaml

// Restores the Quick Style set that was active when the document was opened.
await Word.run(async (context) => {
  const document: Word.Document = context.document;
  const styleSet: Word.ApplyQuickStyleSet = Word.ApplyQuickStyleSet.sessionStart;

  document.applyQuickStyleSet(styleSet);
  await context.sync();

  console.log("Restored the Quick Style set from the start of the session.");
});

字段

sessionStart = "SessionStart"

将快速样式重置为打开文档时使用的样式集。

template = "Template"

将快速样式重置为模板中的样式集(如果有)。