Edit

Share via


PowerPoint.ParagraphHorizontalAlignment enum

Represents the horizontal alignment of the PowerPoint.TextFrame in a PowerPoint.Shape.

Remarks

[ API set: PowerPointApi 1.4 ]

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/shapes/add-modify-tables.yaml

// Specifies the horizontal and vertical alignments of the cells in a table.
await PowerPoint.run(async (context) => {
  const shapes = context.presentation.getSelectedSlides().getItemAt(0).shapes;

  // Add a table, specifying horizontal and vertical alignment.
  shapes.addTable(3, 4, {
    values: [
      ["A", "BB", "CCC", "DDDD"],
      ["E", "FF", "GGG", "HHHH"],
      ["1", "12", "123", "1234"]
    ],
    uniformCellProperties: {
      horizontalAlignment: PowerPoint.ParagraphHorizontalAlignment.justify,
      verticalAlignment: PowerPoint.TextVerticalAlignment.middle
    }
  });
  await context.sync();
});

Fields

center = "Center"

Align text in the center.

distributed = "Distributed"

Distributes the text words across an entire text line.

justify = "Justify"

Align text so that it's justified across the whole line.

justifyLow = "JustifyLow"

Specifies the alignment or adjustment of kashida length in Arabic text.

left = "Left"

Align text to the left margin.

right = "Right"

Align text to the right margin.

thaiDistributed = "ThaiDistributed"

Distributes Thai text specially, because each character is treated as a word.