Hi,
we are using the latest version of Aspose.Words for Java. It seems we have found a bug with handling INCLUDETEXT fields when saving a dot based template as docm file.
Problem:
We have a dot template that contains an IncludeText-function. We save this file as docm per Aspose.
Opening the file will result in a security message in Word (see Word Security Message.png)
If we do the same with a dotm based template, everything is fine. No security message in Word is shown.
Example code for reproducing the scanario:
String path = "c:\\Test\\";
String simpleFileName = "TestIncludeText";
Document documentDOT = new Document(path + simpleFileName + ".dot");
documentDOT.updateFields();
documentDOT.save(path + simpleFileName + " DOT Aspose.docm");
Document documentDOTM_ok = new Document(path + simpleFileName + ".dotm");
documentDOT.updateFields();
documentDOTM_ok.save(path + simpleFileName + " DOTM Aspose.docm");
Note:
In Version 22.4 this works fine - in Version 22.5 the error occured for the first time.
Test files:
Test.zip (136.8 KB)
- Word Security Message.png - Message in Word
- Example.doc - Word document that will be included and must be stored in c:\Test
- TestIncludeText.dot - DOT template that contains an IncludeText-field with reference to c:\Test\Example.doc
- TestIncludeText DOT Aspose.docm - Generated file per Aspose based on DOT → security message
- TestIncludeText.dotm - DOTM variant of template that contains an IncludeText-field with reference to c:\Test\Example.doc
- TestIncludeText DOT Aspose.docm - Generated file per Aspose based on DOTM → ok
Is there any possibility in coding to avoid this result?
Best regards
Matthias