Forums     Knowledge Base     OfficeWriter Online     
 
This documentation is for
OfficeWriter v3.0.4
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelApplication API > CharacterRun

The CharacterRun Object


The CharacterRun class allows you to set a font on a specified range of characters within a ChartText object or a cell. To return a CharacterRun object, use Cell.GetCharacters() or ChartText.GetCharacters().



Examples:

[csharp]
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets[0];
Cell cellA1 = ws.Cells["A1"];
cellA1.Value = "Test";
CharacterRun charRun = cellA1.GetCharacters(0);
[vbnet]
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Dim cellA1 As Cell = ws.Cells("A1")
cellA1.Value = "Test"
Dim charRun As CharacterRun = cellA1.GetCharacters(0)


CharacterRun Properties

Property Type Access Description
Font Font read
write

Sets or returns the font for the CharacterRun

Length int read

Returns the length - in characters - of the CharacterRun

StartIndex int read

Returns the 0-based index of the first character in the CharacterRun



CharacterRun Methods

ReturnsSignature and Description
void Clear ( )

Sets the font of the CharacterRun to the main font of the cell or ChartText object



Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.