Word.ShapeTextOrientation enum

図形内のテキスト フレームの向きを指定します。

注釈

API セット: WordApiDesktop 1.2

使用元

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/45-shapes/manage-shapes-text-boxes.yaml

await Word.run(async (context) => {
  // Sets text frame properties of the first text box in the main document.
  const shape: Word.Shape = context.document.body.shapes.getByTypes([Word.ShapeType.textBox]).getFirstOrNullObject();
  shape.load("textFrame");
  await context.sync();

  if (shape.isNullObject) {
    console.log("No shapes with text boxes found in the main document.");
    return;
  }

  const textFrame: Word.TextFrame = shape.textFrame;
  textFrame.verticalAlignment = Word.ShapeTextVerticalAlignment.bottom;
  textFrame.orientation = Word.ShapeTextOrientation.vertical270;
  textFrame.autoSizeSetting = Word.ShapeAutoSize.shapeToFitText;

  console.log("The first text box's text frame properties were updated:", textFrame);
});

フィールド

eastAsianHorizontalRotated = "EastAsianHorizontalRotated"

一部のフォントが回転したかのように表示される、縦書きテキストの特別なバージョン。

eastAsianVertical = "EastAsianVertical"

一部のフォントが回転したかのように表示される、縦書きテキストの特別なバージョン。

horizontal = "Horizontal"

横書きテキスト。

mixed = "Mixed"

自動方向付けの組み合わせが使用されます。

none = "None"

新しい幾何学的形状など、向きはありません。

vertical = "Vertical"

すべてのテキストが縦方向 (各行が時計回りに 90 度回転) であるかどうかを確認します。

vertical270 = "Vertical270"

すべてのテキストが縦方向 (各行が時計回りに 270 度回転) であるかどうかを確認します。