Поделиться через


Word.ShapeTextWrapType 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 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"

Places фигура за текстом.

front = "Front"

Places фигуру перед текстом.

inline = "Inline"

Places фигуру в соответствии с текстом.

square = "Square"

Обтекает текст прямо вокруг фигуры.

through = "Through"

Обтекает текст вокруг фигуры и по ней.

tight = "Tight"

Обтекает текст рядом с фигурой.

topBottom = "TopBottom"

Places текст над фигурой и под ней.