Free Support Forum - aspose.com

Set one single word in a cell bold(that cell may contain lots of words)

pls let me know if there is any option to set a word in a sentence bold .that sentence exits one single cell.


This message was posted using Aspose.Live 2 Forum

Hi,

Hi,

Yes, you may utilize Cell.Characters() method for your task.

Take a look at the following sample code:

Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
Cells cells = worksheet.Cells;
cells.Merge(0,0,1,3);
cells[0,0].PutValue("This is a test");
cells[0,0].Characters(0,10).Font.IsItalic = true;

//test will be bold in the sentence.
cells[0,0].Characters(10, 4).Font.IsBold = true;
workbook.Save("d:\\test\\out_book.xls");

Thank you.