Hi there,
I inserted html data and change its font an it works using this code below. In addition to font, as the html data is a Table, can we change its cell properties (like width, color, etc)?
private class ReplaceWithHtmlEvaluator : IReplacingCallback
{
public string SomeData { get; set; }
internal ReplaceWithHtmlEvaluator(FindReplaceOptions options)
{
mOptions = options;
}
//This simplistic method will only work well when the match starts at the beginning of a run.
ReplaceAction IReplacingCallback.Replacing(ReplacingArgs args)
{
DocumentBuilder builder = new DocumentBuilder((Document)args.MatchNode.Document);
builder.MoveTo(args.MatchNode);
args.Replacement = "";
Aspose.Words.Font font2 = builder.Font;
font2.Name = "Calibri";
font2.Size = 10;
builder.InsertHtml(SomeData, true);
args.Replacement = "";
return ReplaceAction.Replace;
}
private readonly FindReplaceOptions mOptions;
}
regards