PowerPoint.TextVerticalAlignment enum

Représente l’alignement vertical d’un PowerPoint.TextFrame dans un PowerPoint.Shape. Si l’une des options centrées est sélectionnée, le contenu de la TextFrame sera centré horizontalement dans le Shape groupe. Pour modifier l’alignement horizontal d’un texte, voir PowerPoint.ParagraphFormat et PowerPoint.ParagraphHorizontalAlignment.

Remarques

Jeu d’API : PowerPointApi 1.4

Utilisateur

Exemples

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

Champs

bottom = "Bottom"

Spécifie que doit TextFrame être aligné en bas sur le Shape.

bottomCentered = "BottomCentered"

Spécifie que le TextFrame doit être aligné verticalement en bas par rapport à .Shape Le contenu du TextFrame sera centré horizontalement dans le Shape.

middle = "Middle"

Spécifie que doit TextFrame être aligné au centre de .Shape

middleCentered = "MiddleCentered"

Spécifie que le TextFrame doit être aligné verticalement au centre par rapport à .Shape Le contenu du TextFrame sera centré horizontalement dans le Shape.

top = "Top"

Spécifie que le TextFrame doit être aligné en haut sur le Shape.

topCentered = "TopCentered"

Spécifie que le TextFrame haut doit être aligné verticalement sur le Shape. Le contenu du TextFrame sera centré horizontalement dans le Shape.