Word.BorderWidth enum

注意

この API は開発者向けにプレビューとして提供されており、寄せられたフィードバックにもとづいて変更される場合があります。 この API は運用環境で使用しないでください。

スタイルの罫線の幅を表します。

注釈

[ API セット: WordApi BETA (プレビューのみ) ]

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-styles.yaml

// Updates border properties (e.g., type, width, color) of the specified style.
await Word.run(async (context) => {
  const styleName = $("#style-name").val() as string;
  if (styleName == "") {
    console.warn("Enter a style name to update border properties.");
    return;
  }

  const style = context.document.getStyles().getByNameOrNullObject(styleName);
  style.load();
  await context.sync();

  if (style.isNullObject) {
    console.warn(`There's no existing style with the name '${styleName}'.`);
  } else {
    const borders = style.borders;
    borders.load("items");
    await context.sync();

    borders.outsideBorderType = Word.BorderType.dashed;
    borders.outsideBorderWidth = Word.BorderWidth.pt025;
    borders.outsideBorderColor = "green";
    console.log("Updated outside borders");
  }
});

フィールド

mixed = "Mixed"

幅が混在しています。

none = "None"

[なし] の幅。

pt025 = "Pt025"

0.25 ポイント

pt050 = "Pt050"

0.50 ポイント

pt075 = "Pt075"

0.75 ポイント

pt100 = "Pt100"

1.00 ポイント。 これが既定です。

pt150 = "Pt150"

1.50 ポイント

pt225 = "Pt225"

2.25 ポイント

pt300 = "Pt300"

3.00 ポイント

pt450 = "Pt450"

4.50 ポイント

pt600 = "Pt600"

6.00 ポイント