We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Use MS Word Template File (.dot) as a Blank Document

Dear Aspose Support,

We have a Word template file (.dot) with some MACRO code (VBA) in it to make some menu items and other functions that can be used inside Word.

If we used Aspose to open this template then insert contents to it without touching MACRO code then we generate a regular .doc file out of it. After then if we open this .doc file using MS Word, will all MACRO code still work correctly?

I did some simple tests and it looks like OK but I want to confirm it.

Thanks,

Ligong

Hi Ligong,

<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. Aspose.Words preserves macros during processing documents. You can attach your sample document here. I will check it on my side and provide you more information.

Best regards.

Hi Alex,

Can you take a look at this file (LZ3.docum)? When I open it directly I would see some message boxes popped up. It's from macro code inside document open event. But if I use Aspose (java) to open this file and update it with anything (like insert a line text) then save to disk, I won't see message box any more when I open the file from file system. But if I open the macro code now and make any change then save it, it will work again. It looks like some problem with Aspose save. I attached two files. One is the original file, another one (after.docm) is the result file that macro won't work. Please advice.

Thanks,

Ligong

Hi there,

Thank you for this additional information.

Preserving macros works correctly on the .NET version but was not yet included in the Java version. We are working on synchronizing the .NET and Java versions of Aspose.Words. Once we finish this work all functionality which is supported in the NET version will be supported in Java version, including macro preservation. You can expect this release within 1-2 weeks. We will keep you informed

Thanks,