Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

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

Hi, can you provide some source code that you have tried? Did you get any exception or are you using some documentation for reference? Nemanja Todorovic May 25, 2020 at 17:09

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
        

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.