Word.LineWidth enum

オブジェクトの境界線の幅を指定します

注釈

API セット: WordApiDesktop 1.3

使用元

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/25-paragraph/add-border-to-paragraph.yaml

if (!Office.context.requirements.isSetSupported("WordApiDesktop", "1.3")) {
  console.error("This sample requires WordApiDesktop 1.3 or later.");
  return;
}

await Word.run(async (context) => {
  // Insert a paragraph at the beginning of the document.
  const paragraph: Word.Paragraph =
    context.document.body.insertParagraph(
      "Note: Added a border to this paragraph.",
      Word.InsertLocation.start
    );

  // Load the paragraph borders so they can be formatted.
  const borders: Word.BorderUniversalCollection = paragraph.borders;
  borders.load("items");
  await context.sync();

  // Apply a visible double blue line to every side of the paragraph.
  borders.items.forEach((border: Word.BorderUniversal) => {
    border.isVisible = true;
    border.color = "#4472C4";
    border.lineStyle = Word.BorderLineStyle.double;
    border.lineWidth = Word.LineWidth.pt150;
  });

  await context.sync();

  console.log(
    `Applied the ${Word.BorderLineStyle.double} line style to ${borders.items.length} paragraph borders.`
  );
});

フィールド

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 ポイントの線幅を表します。