PowerPoint.TextVerticalAlignment enum

PowerPoint.Shape での PowerPoint.TextFrame の垂直方向の配置を表します。 中央揃えオプションのいずれかが選択されている場合、 TextFrame の内容は、グループとして Shape 内で水平方向に中央に配置されます。 テキストの水平方向の配置を変更するには、「 PowerPoint.ParagraphFormat 」および「 PowerPoint.ParagraphHorizontalAlignment」を参照してください。

注釈

API セット: PowerPointApi 1.4

使用元

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

// This function gets the collection of shapes on the first slide,
// and adds a brace pair, {}, to the collection, while specifying its
// location and size. Then it names the shape, sets its text and font
// color, and centers it inside the braces.
await PowerPoint.run(async (context) => {
  const shapes: PowerPoint.ShapeCollection = context.presentation.slides.getItemAt(0).shapes;
  const braces: PowerPoint.Shape = shapes.addGeometricShape(PowerPoint.GeometricShapeType.bracePair, {
    left: 100,
    top: 400,
    height: 50,
    width: 150,
  });
  braces.name = "Braces";
  braces.textFrame.textRange.text = "Shape text";
  braces.textFrame.textRange.font.color = "purple";
  braces.textFrame.textRange.font.underline = PowerPoint.ShapeFontUnderlineStyle.heavy;
  braces.textFrame.verticalAlignment = PowerPoint.TextVerticalAlignment.middleCentered;
  braces.textFrame.autoSizeSetting = PowerPoint.ShapeAutoSize.autoSizeShapeToFitText;

  return context.sync();
});

フィールド

bottom = "Bottom"

TextFrameShapeに合わせて下部に揃えるように指定します。

bottomCentered = "BottomCentered"

TextFrameShapeに対して垂直方向に下部に揃えられるように指定します。 TextFrameの内容は、Shape内で水平方向に中央に配置されます。

middle = "Middle"

TextFrameShapeに対して中央揃えになるように指定します。

middleCentered = "MiddleCentered"

TextFrameShapeに対して垂直方向に中央揃えになるように指定します。 TextFrameの内容は、Shape内で水平方向に中央に配置されます。

top = "Top"

TextFrameShapeに上揃えるように指定します。

topCentered = "TopCentered"

TextFrameShapeに対して垂直方向に上揃えになるように指定します。 TextFrameの内容は、Shape内で水平方向に中央に配置されます。