[]
Returns a ITextRun object that represents a range of characters within the cell text, this method can only be called when the value of cell is a string, or else InvalidOperationException is thrown.
ITextRun Characters(int startIndex, int length)
Function Characters(startIndex As Integer, length As Integer) As ITextRun
| Type | Name | Description |
|---|---|---|
| int | startIndex | the start index of characters in whole cell text. |
| int | length | the length of characters. |
| Type | Description |
|---|---|
| ITextRun | A ITextRun object that represents the range of characters. |
worksheet.Range["A1"].Value = "Document Solutions";
ITextRun run = worksheet.Range["A1"].Characters(1, 8);
run.Font.Bold = true;
string text = run.Text;