Word.SelectionInsertSymbolOptions interface

表示 Selection.insertSymbol 方法的选项。

注解

API 集:WordApiDesktop 1.4

使用方

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/55-selection/insert-symbol.yaml

// Inserts a Wingdings checkmark (ANSI character 252) at the selection.
// The font option selects the symbol font, unicode: false uses the ANSI code point,
// and bias: Word.FontBias.standard ensures the standard (non-East-Asian) glyph is used.
await Word.run(async (context) => {
  const options: Word.SelectionInsertSymbolOptions = {
    font: "Wingdings",
    unicode: false,
    bias: Word.FontBias.standard,
  };
  context.document.selection.insertSymbol(252, options);
  await context.sync();

  console.log("Inserted Wingdings checkmark (character 252).");
});

属性

bias

如果提供,则指定符号的字体偏差。 此参数可用于设置东亚字符正确的字体斜线。 默认值为 standard

font

如果提供,则指定包含符号的字体的名称。

unicode

如果提供,则指定字符是否为 Unicode。 true在调用该方法时Selection.insertSymbol插入属性指定的 characterNumber Unicode 字符;false而是插入该属性指定的 characterNumber ANSI 字符。 默认值为 false

属性详细信息

bias

如果提供,则指定符号的字体偏差。 此参数可用于设置东亚字符正确的字体斜线。 默认值为 standard

bias?: Word.FontBias | "Standard" | "FarEast" | "NoSpecified";

属性值

Word.FontBias | "Standard" | "FarEast" | "NoSpecified"

注解

API 集:WordApiDesktop 1.4

font

如果提供,则指定包含符号的字体的名称。

font?: string;

属性值

string

注解

API 集:WordApiDesktop 1.4

unicode

如果提供,则指定字符是否为 Unicode。 true在调用该方法时Selection.insertSymbol插入属性指定的 characterNumber Unicode 字符;false而是插入该属性指定的 characterNumber ANSI 字符。 默认值为 false

unicode?: boolean;

属性值

boolean

注解

API 集:WordApiDesktop 1.4