Hello,
I’m have a Document that I have run through a mailmerge process but in many cases this document will have fields that weren’t merged. I am trying to highlight these unmerged fields(strictly speaking I’m trying to replace them with the Fieldname as a Highlighted text but whenever I try the highlight isn’t applied.
This is what I have right now:
//mainDoc is the Document object that has already gone through the merge process
String[] remainingFields = mainDoc.MailMerge.GetFieldNames();
DocumentBuilder postProcessBuilder = new DocumentBuilder(mainDoc);
Shading shd = postProcessBuilder.Font.Shading;
shd.Texture = TextureIndex.TextureSolid;
shd.BackgroundPatternColor = System.Drawing.Color.Red;
shd.ForegroundPatternColor = System.Drawing.Color.Red;
//I've tried similar with postProcessBuilder.Font.HighlightColor = System.Drawing.Color.Red; but
//again, the fields are replaced but not highlighted
for (int i = 0; i < remainingFields.Length; i++)
{
String fieldText = remainingFields[i];
postProcessBuilder.MoveToMergeField(fieldText);
postProcessBuilder.Write(fieldText);
}
//mainDoc.save(...)