0

I have to read an XLSX with NPOI. In my xlsx there are cells which they have bold words, there is a way to find those words using NPOI?

Thank you

Ghil
  • 1
  • 1

1 Answers1

0

The only way I found was to loop on each char of the richtext

XSSFRichTextString s = (XSSFRichTextString)c.RichStringCellValue;

for (int t = 0; t < s.Length; t++)
{
    var myfont = s.GetFontAtIndex(t);
    if (myfont != null && myfont.IsBold)
        boldCharactersIndex.Add(t); // boldCharactersIndex is a list of indexes with bold chars
}
Ghil
  • 1
  • 1