Aspose::Words::BorderType enum

BorderType enum

Specifies sides of a border. To learn more, visit the Programming with Documents documentation article.

enum class 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.

auto doc = MakeObject<Document>();
auto builder = MakeObject<DocumentBuilder>(doc);

SharedPtr<Border> topBorder = builder->get_ParagraphFormat()->get_Borders()->idx_get(BorderType::Top);
topBorder->set_Color(System::Drawing::Color::get_Red());
topBorder->set_LineWidth(4.0);
topBorder->set_LineStyle(LineStyle::DashSmallGap);

builder->Writeln(u"Text with a red top border.");

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

See Also