Word.LineWidth enum

Gibt die Breite des Rahmens eines Objekts an.

Hinweise

API-Satz: WordApiDesktop 1.3

Verwendet von

Beispiele

// 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.`
  );
});

Felder

pt025 = "Pt025"

Entspricht einer Linienbreite von 0,25 Punkt.

pt050 = "Pt050"

Stellt eine Linienbreite von 0,50 Punkten dar.

pt075 = "Pt075"

Stellt eine Linienbreite von 0,75 Punkt dar.

pt100 = "Pt100"

Stellt eine Linienbreite von 1,00 Punkt dar.

pt150 = "Pt150"

Stellt eine Linienbreite von 1,50 Punkt dar.

pt225 = "Pt225"

Stellt eine Linienbreite von 2,25 Punkt dar.

pt300 = "Pt300"

Entspricht einer Linienbreite von 3,00 Punkt.

pt450 = "Pt450"

Entspricht einer Linienbreite von 4,50 Punkt.

pt600 = "Pt600"

Stellt eine Linienbreite von 6,00 Punkten dar.