Hi there ,
Thanks for your inquiry. Please note DOCX is macro free document along with DOTX and FlatOpc (Word 2007 XML) formats. All other MS Word formats DOCM, DOTM, DOC, RTF, WML (Word 2003 XML) can contain macros. So if you want to preserve macros in your output document, you should use DOCM (macro-enabled DOCX format) instead of DOCX.
You can check whether Document contains macros using HasMacros property and save document accordingly. However, if you would like to save your document as DOCX, you should remove macros
Document doc = new Document(“in.doc”);<o:p></o:p>
Please feel free to contact us for any further assistance.