Word.Alignment enum

表示文本的水平对齐方式。

注解

API 集:WordApi 1.1

使用方

示例

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/25-paragraph/paragraph-properties.yaml

// Centers the last paragraph between the document margins.
await Word.run(async (context) => {
  const lastParagraph: Word.Paragraph = context.document.body.paragraphs.getLast();
  const alignment: Word.Alignment = Word.Alignment.centered;
  lastParagraph.alignment = alignment;

  await context.sync();
});

字段

centered = "Centered"

居中对齐。

justified = "Justified"

完全两端对齐。

left = "Left"

向左对齐。

mixed = "Mixed"

混合水平对齐。

right = "Right"

向右对齐。

unknown = "Unknown"

未知对齐方式。