Free Support Forum -

Formatting text during mail merge

I am formatting text in a table cell during a mail merge. A snippet from a select case statement in the fieldmerging event is provided below. I am having an issue in that for the case "Action Suggested" only the word "Action" has a white font, while "Suggested" is black. For the case "Red", which has an underlying value of "(0.34)", the result has the initial parens white and the remainder black. I am using version of aspose.words. Am I doing something incorrectly?

case "RED":
cell.CellFormat.Shading.BackgroundPatternColor = badColor;
foreach (Run run in cell.GetChildNodes(NodeType.Run, true))
run.Font.Color = Color.White;

Hi Dan,

Thanks for your inquiry. Yes, you are correctly setting the color of Run node. I would suggest you please upgrade to the latest version (v13.4.0) from here and let us know how it goes on your side. If the problem still remains, please attach your input Word document here for testing. I will investigate the issue on my side and provide you more information.