次の方法で共有


Word.ShapeTextWrapSide enum

文書のテキストを、指定した図形の両側、左辺または右側、またはそれぞれのページ余白から離れた図形の側に折り返すかどうかを指定します。

注釈

[ API set: 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 wrap properties of the first text box.
  const firstShapeWithTextBox: Word.Shape = context.document.body.shapes
    .getByTypes([Word.ShapeType.textBox])
    .getFirstOrNullObject();
  firstShapeWithTextBox.load("textWrap");
  await context.sync();

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

  const textWrap: Word.ShapeTextWrap = firstShapeWithTextBox.textWrap;
  textWrap.type = Word.ShapeTextWrapType.square;
  textWrap.side = Word.ShapeTextWrapSide.both;

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

フィールド

both = "Both"

図形の左右両方の辺。

largest = "Largest"

それぞれのページ余白から離れた図形の側面。

left = "Left"

図形の左側のみ。

none = "None"

インライン図形の場合など、ラップ側プロパティがありません。

right = "Right"

図形の右側のみ。