Search code examples
.netexcelax

Inline cell formatting in Excel with Excel Object Model


I have an excel table with inline formatting - only one word in the cell is bold, for example. When I read the cell value I get a plain text BSTR. How can I get the formatting?

I'm doing this in AX but I guess it's the same as in C# or anything else that uses the Excel Interop library.

Thanks


Solution

  • You want the Characters property of the cell. Referenced as
    expression.Characters(Start, Length)

    eg Range("A1").Characters(3,1).Font.Bold will tell if the third character is Bold