Edit

Word.Alignment enum

Represents the horizontal alignment of text.

Remarks

API set: WordApi 1.1

Used by

Examples

// 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();
});

Fields

centered = "Centered"

Alignment to the center.

justified = "Justified"

Fully justified alignment.

left = "Left"

Alignment to the left.

mixed = "Mixed"

Mixed horizontal alignment.

right = "Right"

Alignment to the right.

unknown = "Unknown"

Unknown alignment.