NativeExcel for .Net Developer's Reference

ICharacters.Font Property

Returns an IFont interface that represents the font of the specified Characters object.

[Visual Basic]

Property Value

IFont interface.


This example sets the font and font size for the second character in each cell within A1:F2 range to 12-point bold Arial.

IFont font = book.Worksheets[1].Range["A1:F2"].Characters[2,1].Font;
font.Name = "Arial";
font.Size = 12;
font.Bold = true;
Dim font As IFont = book.Worksheets(1).Range("A1:F2").Characthers(2,1).Font
font.Name = "Arial"
font.Size = 12
font.Bold = True
IRange* range = book->Worksheets->Item[1]->Range->Item[S"A1:F2"];
IFont* font = range->Characters->Item[2,1]->Font;
font->Name = S"Arial";
font->Size = 12;
font->Bold = true;
The following example gets the font name of the second character in B2 cell.
string name = book.Worksheets[1].Range["B2"].Characters[2,1].Font.Name;
Dim name As String = book.Worksheets(1).Range("B2").Characthers(2,1).Font.Name
IRange* cell = book->Worksheets->Item[1]->Range->Item[S"B2"];
String* name = cell->Characters->Item[2,1]->Font->Name;

See Also

ICharacters Interface | NativeExcel Namespace | IRange.Characters Property