NativeExcel2 for .Net Developer's Reference

ILineFormat.Style Property

Gets or sets a value that represents the style of the specified line.

[Visual Basic]
PropertyStyleAsMsoLineStyle
[C#]
MsoLineStyleStyle{get;set;}
[C++]
__propertyMsoLineStyleget_Style();
__propertyvoidset_Style(MsoLineStyle);
[JScript]
functiongetStyle():MsoLineStyle
functionsetStyle(MsoLineStyle);

Property Value

One of the MsoLineStyle values.

Example

This example creates new comment on cell B2 with double red border

[C#]
IComment comment = book.Worksheets[1].Range["B2"].AddComment("Comment text");
ILineFormat line = comment.Shape.Line;
line.Style     = MsoLineStyle.msoLineThinThin;
line.Weight    = 2.25;
line.ForeColor.RGB = Color.FromArgb(0x0000FF);
[VisualBasic]
Dim comment As IComment = book.Worksheets(1).Range("B2").AddComment("Comment text")
Dim line As ILineFormat = comment.Shape.Line
line.Style     = MsoLineStyle.msoLineThinThin
line.Weight    = 2.25
line.ForeColor.RGB = Color.FromArgb(&H0000FF)
[C++]
IComment* comment = book->Worksheets->Item[1]->Range->Item[S"B2"]->AddComment(S"Comment text");
ILineFormat* line = comment->Shape->Line;
line->Style     = MsoLineStyle::msoLineThinThin;
line->Weight    = 2.25;
line->ForeColor->RGB = Color::FromArgb(0x0000FF);

See Also

ILineFormat Interface | NativeExcel Namespace