Update of nested fields in INCLUDEPICTURE does not work

Hi,

it seems that update of nested REF fields within field INCLUDEPICTURE does not work.

I have document with following fields:
{ SET Grafik “Tree.jpg” }
Row1: { REF Grafik }
Row2: { INCLUDEPICTURE { REF Grafik}}

Now update all fields in document using Microsoft Office (–> FieldResults are updated)
Result: Tree is shown in Row1 (as text) and Row2 (as Picture)
So far so good.

Now change value in Set-field Grafik and save document.
{ SET Grafik “Flower.jpg” }
No update is done - tree is still shown in both rows
This state of document is saved with attachement: TestIncludePicture.dot
So far so good.

Problem:

  • Update complete document using Microsoft Office:
    Result:

    • ok: Flower is now shown in Row1 as text
    • ok: Flower is now shown in Row2 as Picture
  • Update complete document using Aspose Word 17.7:
    Result:

    • ok: Flower is now shown in Row1 as text
    • error: Tree is still shown in Row2 as Picture

See attachements to reproduce the problem. Source directory of attachments must be adapted in java example.
170914 IncludePicture Nested Fields.zip (37.8 KB)

Thanks a lot
Best regards
Matthias

@curmas,

Thanks for your inquiry. Please use LoadOptions.PreserveIncludePictureField property to get or set whether to preserve the INCLUDEPICTURE field when reading Microsoft Word formats. Please the value of this property as true to get the desired output.

LoadOptions options = new LoadOptions();
options.setPreserveIncludePictureField(true);
Document doc = new Document("TestIncludePicture.dot", options);
doc.updateFields();
doc.save("output.doc");

It works fine. Thanks a lot!

Best regards
Matthias

@curmas,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.