NativeExcel2 for .Net Developer's Reference

IRange.Font Property

Returns an IFont interface that represents the font of the specified range

[Visual Basic]
PropertyReadOnlyFontAsIFont
[C#]
IFontFont{get;}
[C++]
__propertyIFont*get_Font();
[JScript]
functiongetFont():IFont

Property Value

IFont interface.

Example

This example sets the font and font size for A1:F2 cells on first sheet to 12-point bold Arial.

[C#]
IFont font = book.Worksheets[1].Range["A1:F2"].Font;
font.Name = "Arial";
font.Size = 12;
font.Bold = true;
[VisualBasic]
Dim font As IFont = book.Worksheets(1).Range("A1:F2").Font
font.Name = "Arial"
font.Size = 12
font.Bold = True
[C++]
IFont* font = book->Worksheets->Item[1]->Range->Item[S"A1:F2"]->Font;
font->Name = S"Arial";
font->Size = 12;
font->Bold = true;

See Also

IRange Interface | NativeExcel Namespace | IFont Interface