Hi,
Thanks for the quick reply.
Can I differently format parts of the replaced field using Merge Field event handler.
I have attached how I would like template to look like and what output will be.
Notice how characters are differently formatted. This is based on some rules in the application.
Is there any way to accomplish this. If so can you please explain how (bookmarks, find replace).
I have partially made it work with the bookmarks, but bookmarks are not working for last two cells (no value is filled in place of bookmark).
Here is the code example:
foreach (Bookmark bookmark in document.Bookmarks)
{
bk.MoveToBookmark(bookmark.Name,false,true);
text = "Red, strikethrough";
range = bk.InsertText (text);
range.CharacterFormat.Strikeout = true;
range.CharacterFormat.TextColor = System.Drawing.Color.Red;
range = bk.InsertText("Blue, underline");
range.CharacterFormat.UnderlineStyle = UnderlineStyle.Single;
range.CharacterFormat.TextColor = System.Drawing.Color.Blue;
}
Thanks in advance.
field_format_example.zip