次の方法で共有


Word.ShapeTextWrapType 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);
});

フィールド

behind = "Behind"

図形を文字列の背面に配置します。

front = "Front"

図形を文字列の前面に配置します。

inline = "Inline"

図形をテキストと一緒にPlacesします。

square = "Square"

図形の周囲にテキストを四角形で折り返します。

through = "Through"

図形の前後にテキストを折り返します。

tight = "Tight"

図形に近接している文字列を折り返します。

topBottom = "TopBottom"

文字列を図形の上下に配置します。