BorderType

BorderType enumeration

Specifies sides of a border.

To learn more, visit the Programming with Documents documentation article.

public enum BorderType

Values

NameValueDescription
None-1Default value.
Bottom0Specifies the bottom border of a paragraph or a table cell.
Left1Specifies the left border of a paragraph or a table cell.
Right2Specifies the right border of a paragraph or a table cell.
Top3Specifies the top border of a paragraph or a table cell.
Horizontal4Specifies the horizontal border between cells in a table or between conforming paragraphs.
Vertical5Specifies the vertical border between cells in a table.
DiagonalDown6Specifies the diagonal border in a table cell.
DiagonalUp7Specifies the diagonal border in a table cell.

Examples

Shows how to insert a paragraph with a top border.

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Border topBorder = builder.ParagraphFormat.Borders.Top;
topBorder.LineWidth = 4.0d;
topBorder.LineStyle = LineStyle.DashSmallGap;
// Set ThemeColor only when LineWidth or LineStyle setted.
topBorder.ThemeColor = ThemeColor.Accent1;
topBorder.TintAndShade = 0.25d;

builder.Writeln("Text with a top border.");

doc.Save(ArtifactsDir + "Border.ParagraphTopBorder.docx");

See Also