Hi Team,
I am trying to apply the font color for heading 1 I used the below-mentioned code. here I am facing one problem in the heading-"1. TABLE OF CONTENTS " TABLE -red color, OF CONTENTS - Dark Blue color.
The below code is not working for the above case.
Note: I don’t want to override the correct data.
Please find the below input and expected output.
Expected output Table of Contents-.docx (14.6 KB)
Input Table of Contents.docx (14.6 KB)
Style heading1 = ruleBaseModel.SourceDocument.Styles[StyleIdentifier.Heading1];
var value = "Dark Blue";
var isColor = heading1.Font.Color.Name == "ff2f5496" ? "Dark Blue" : "Othercolor";
if (isColor != value.Trim())
{
heading1.Font.Color = Color.DarkBlue;
}