I have some questions regarding macros in Aspose.
Please see the two templates attached. macros.zip (33.4 KB)
When I open “beforeMacrosRemoved” in Microsoft Word I cannot see any macros, but when I open it using Aspose and after some operations I want to save it as .dot/.dotx Aspose does not allow me (throwing error).
Document document = new Document(MyDir + "beforeMacrosRemoved.dot"); document.Save(MyDir + "beforeMacrosRemoved.dot");
When I check if it has macros before saving and remove them, then I cant save the document as .dot/.dotx. Then when I open this document “afterMacrosRemoved” in Microsoft Word it looks the same as “beforeMacrosRemoved”. When I open it using Aspose I can save it without RemoveMacros logic.
Document document = new Document(MyDir + "beforeMacrosRemoved.dot"); if(document.HasMacros) document.RemoveMacros(); document.Save(MyDir + "beforeMacrosRemoved.dot");
If I open the two documents as xml they both have this attribute with yes - w:macrosPresent=“yes”.
Can you tell me why Aspose sees the first document, as if it had macros?