Word.BorderLineStyle enum
Specifies the border style for an object.
Remarks
Used by
Examples
// 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.`
);
});
Fields
| dashDot = "DashDot" | Dash-dot line style. |
| dashDotDot = "DashDotDot" | Dash-dot-dot line style. |
| dashDotStroked = "DashDotStroked" | Dash-dot stroked line style. |
| dashLargeGap = "DashLargeGap" | Dashed line style with large gaps. |
| dashSmallGap = "DashSmallGap" | Dashed line style with small gaps. |
| dot = "Dot" | Dotted line style. |
| double = "Double" | Double line style. |
| doubleWavy = "DoubleWavy" | Double wavy line style. |
| emboss3D = "Emboss3D" | Embossed 3D line style. |
| engrave3D = "Engrave3D" | Engraved 3D line style. |
| inset = "Inset" | Inset line style. |
| none = "None" | No line style. |
| outset = "Outset" | Outset line style. |
| single = "Single" | Single line style. |
| singleWavy = "SingleWavy" | Single wavy line style. |
| thickThinLargeGap = "ThickThinLargeGap" | Thick-thin line style with large gaps. |
| thickThinMedGap = "ThickThinMedGap" | Thick-thin line style with medium gaps. |
| thickThinSmallGap = "ThickThinSmallGap" | Thick-thin line style with small gaps. |
| thinThickLargeGap = "ThinThickLargeGap" | Thin-thick line style with large gaps. |
| thinThickMedGap = "ThinThickMedGap" | Thin-thick line style with medium gaps. |
| thinThickSmallGap = "ThinThickSmallGap" | Thin-thick line style with small gaps. |
| thinThickThinLargeGap = "ThinThickThinLargeGap" | Thin-thick-thin line style with large gaps. |
| thinThickThinMedGap = "ThinThickThinMedGap" | Thin-thick-thin line style with medium gaps. |
| thinThickThinSmallGap = "ThinThickThinSmallGap" | Thin-thick-thin line style with small gaps. |
| triple = "Triple" | Triple line style. |