Word.BorderLineStyle enum
指定对象的 边框 样式。
注解
使用方
示例
// 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.`
);
});
字段
| dashDot = "DashDot" | 虚线样式。 |
| dashDotDot = "DashDotDot" | 虚线-点-点线样式。 |
| dashDotStroked = "DashDotStroked" | 虚线点划线样式。 |
| dashLargeGap = "DashLargeGap" | 间隙较大的虚线样式。 |
| dashSmallGap = "DashSmallGap" | 带小间隙的虚线样式。 |
| dot = "Dot" | 虚线样式。 |
| double = "Double" | 双线样式。 |
| doubleWavy = "DoubleWavy" | 双波浪线样式。 |
| emboss3D = "Emboss3D" | 浮雕 3D 线条样式。 |
| engrave3D = "Engrave3D" | 雕刻的 3D 线条样式。 |
| inset = "Inset" | 插入线条样式。 |
| none = "None" | 无线条样式。 |
| outset = "Outset" | 出端线样式。 |
| single = "Single" | 单线样式。 |
| singleWavy = "SingleWavy" | 单波浪线样式。 |
| thickThinLargeGap = "ThickThinLargeGap" | 粗细线样式,间隙大。 |
| thickThinMedGap = "ThickThinMedGap" | 粗细线样式,中间缝隙。 |
| thickThinSmallGap = "ThickThinSmallGap" | 粗细线样式,缝隙小。 |
| thinThickLargeGap = "ThinThickLargeGap" | 缝隙较大的细粗线样式。 |
| thinThickMedGap = "ThinThickMedGap" | 具有中等间隙的细粗线样式。 |
| thinThickSmallGap = "ThinThickSmallGap" | 细粗线样式,间隙小。 |
| thinThickThinLargeGap = "ThinThickThinLargeGap" | 细-粗-细线样式,间隙大。 |
| thinThickThinMedGap = "ThinThickThinMedGap" | 细-粗-细线样式,具有中等间隙。 |
| thinThickThinSmallGap = "ThinThickThinSmallGap" | 细-粗-细线样式,缝隙小。 |
| triple = "Triple" | 三线样式。 |