Represents line formatting. For a shape with a border, this interface contains formatting information for the shape's border.
For a list of all members of this type, see ILineFormat Members.
[Visual Basic] Public Interface ILineFormat [C#] public interface ILineFormat [C++] public __gc __interface ILineFormat [JScript] public interface ILineFormat
Use the Line property to return an ILineFormat interface.
The following example adds a green, dashed border to first shape on sheet one.
[C#]
IShapes shapes = book.Worksheets[1].Shapes;
if (shapes.Count > 0) {
ILineFormat line = shapes[1].Line;
line.Style = MsoLineStyle.msoLineSingle;
line.DashStyle = MsoLineDashStyle.msoLineDash;
line.Weight = 2;
line.Visible = true;
line.ForeColor.RGB = System.Drawing.Color.FromArgb(0x00A000);
}
[Visual Basic]
Dim shapes As IShapes = book.Worksheets(1).Shapes
If shapes.Count > 0 Then
Dim line As ILineFormat = shapes(1).Line
line.Style = MsoLineStyle.msoLineSingle
line.DashStyle = MsoLineDashStyle.msoLineDash
line.Weight = 2
line.Visible = True
line.ForeColor.RGB = System.Drawing.Color.FromArgb(&H00A000)
End If
[C++]
IShapes* shapes = book->Worksheets->Item[1]->Shapes;
if (shapes->Count > 0) {
ILineFormat* line = shapes->Item[1]->Line;
line->Style = MsoLineStyle::msoLineSingle;
line->DashStyle = MsoLineDashStyle::msoLineDash;
line->Weight = 2;
line->Visible = true;
line->ForeColor.RGB = System::Drawing::Color::FromArgb(0x00A000);
}
Namespace: NativeExcel
Assembly: NativeExcel (in NativeExcel.dll)
ILineFormat Members | NativeExcel Namespace | IShape.Line Property | IShape interface