I have a piece of java code, which updates the embedded excel tables in a docx, using docx4j. However, when I open the docx file, those embedded tables seem to not be updated until I click to activate them.
I found in the documentation for XWPFDocument a method called enforceUpdateFields, which basically enforces fields update on document open. Also mentioned in that documentation, it will sets the updateSettings value to true in the settings.xml, which, unfortunately, causes this message being asked for every embedded tables everytime I open the docx file:
This document contains fields that may refer to other files. Do you want to update the fields in this documents ?
After many researches, there is no solution I could find to suppress that message programatically .
The thing I want to achieve:
- Update the embedded excel tables inside the docx without manual activation, or
- Suppress the confirmation message
Glad to get advices or suggestions to overcome the issue :)