Returns or sets the line style for the border. Read/write XlLineStyle.
[Visual Basic] Property LineStyle As XlLineStyle [C#] XlLineStyle LineStyle { get; set; } [C++] __property XlLineStyle get_LineStyle(); __property void set_LineStyle(XlLineStyle ); [JScript] function get LineStyle() : XlLineStyle function set LineStyle(XlLineStyle);
This example puts a border around the A1:C5 range.
[C#]
IBorders borders = book.Worksheets[1].Range["A1:C5"].Borders;
borders[XlBordersIndex.xlEdgeTop].LineStyle = XlLineStyle.xlDot;
borders[XlBordersIndex.xlEdgeBottom].LineStyle = XlLineStyle.xlDot;
borders[XlBordersIndex.xlEdgeLeft].LineStyle = XlLineStyle.xlDot;
borders[XlBordersIndex.xlEdgeRight].LineStyle = XlLineStyle.xlDot;
[Visual Basic]
Dim borders As IBorders = book.Worksheets(1).Range("A1:C5").Borders
borders(XlBordersIndex.xlEdgeTop).LineStyle = XlLineStyle.xlDot
borders(XlBordersIndex.xlEdgeBottom).LineStyle = XlLineStyle.xlDot
borders(XlBordersIndex.xlEdgeLeft).LineStyle = XlLineStyle.xlDot
borders(XlBordersIndex.xlEdgeRight).LineStyle = XlLineStyle.xlDot
[C++]
IBorders* borders = book->Worksheets->Item[1]->Range->Item[S"A1:C5"]->Borders;
borders->Item[XlBordersIndex::xlEdgeTop]->LineStyle = XlLineStyle::xlDot;
borders->Item[XlBordersIndex::xlEdgeBottom]->LineStyle = XlLineStyle::xlDot;
borders->Item[XlBordersIndex::xlEdgeLeft]->LineStyle = XlLineStyle::xlDot;
borders->Item[XlBordersIndex::xlEdgeRight]->LineStyle = XlLineStyle::xlDot;
This example is the same as the previous. [C#]
book.Worksheets[1].Range["A1:C5"].Borders[XlBordersIndex.xlAround].LineStyle = XlLineStyle.xlDot;
[Visual Basic]
book.Worksheets(1).Range("A1:C5").Borders(XlBordersIndex.xlAround).LineStyle = XlLineStyle.xlDot
[C++]
IBorders* borders = book->Worksheets->Item[1]->Range->Item[S"A1:C5"]->Borders;
borders->Item[XlBordersIndex::xlAround]->LineStyle = XlLineStyle::xlDot;
IBorder Interface | NativeExcel Namespace | XlLineStyle Enumeration | IRange.Borders Property | IBorders Interface