IF field with embedded images

Hi

I am using Aspose.Words to fill and update fields. The data is added to the document by inserting SET fields containing the data and then calling UpdateFields() on the document. This has been working very well. We have now come across an issue where an IF field has embedded images as results, while it will
select the correct one it will also output both choices again so you get three
images (the one chosen and the two choices) instead of just the one chosen, if
you edit the attached program.cs so UpdateFields() is not done in Aspose (just the SETstuff)
and the open in Word and call update fields in Word it works….just one image.

Example template document and code attached.

Any help greatly appreciated.

Thanks

Mark

Hi Mark,

Thanks for your inquiry. Please add following DocumentVisitor.VisitShapeStart method in FieldsHelper class to fix this issue.

public override VisitorAction VisitShapeStart(Shape shape)
{
    CheckDepthAndRemoveNode(shape);
    return VisitorAction.Continue;
}

Thanks Tahir, that appears to have fixed it.

Just to say great service from you guys again.

Cheers

Mark