Reading font information

Hi, I am trying to read font information during runs to check for a specific match. But anytime I try to look at the font Color info, it returns 0. My code is


NodeCollection runCollection = doc.GetChildNodes(NodeType.Run, true);
foreach (Run run in runCollection)
{
if (run.Text == “test”)
{
Console.WriteLine(run.Font.Color.Name);
}
}

I have tried both doc and docx formats. I’d appreciate some help here.

Thanks

Hi Shams,


Thanks for your inquiry. Please attach your Word document here for testing. I will investigate your scenario and provide you code to achieve what you’re looking for.

Best regards,