Hi,
we create a .docx document based on a template. The template contains the following structure:
{ SET picName "http://some.url/icon_{MERGEFIELD Test_MergeField \* MERGEFORMAT}.jpg" } {INCLUDEPICTURE { REF picName } \* MERGEFORMAT}
This is supposed to insert an image into the document, whose URL is built by merge field, depending on the specified value. Merge field is filled in when creating the document and it looks correct in the resulting document:
{ SET picName "http://some.url/icon_test.jpg" } {INCLUDEPICTURE { REF picName } \* MERGEFORMAT}
However, the image does not display correctly, and instead you see the text
Error! Filename not specified.
This can be fixed manually by right click and updating the REF field, or by using a macro in the document:
Private Sub Document_Open()
ActiveDocument.Fields.Update
End Sub
Is it possible to do such an update using Aspose.Words?
doc.UpdateFields() has no effect here, using “loadOptions.PreserveIncludePictureField = true;” doesn’t seem to have any effect either.
Best regards,
Artur