There are a couple of ways that you can extract macros from a Word document. What follows is one of my go-to tools called OfficeMalScanner. We’re going to be using a .docm file called Order_details_U96144.docm. You can download it here.
This tool is an old one, but it is a workhorse for me. There are a few options here, but when it comes to ripping out macros, you’re going to need the two options called ‘info’ and ‘inflate’.
scan: Use this for the older style .doc files and the like; it will save any macros to a new folder.
inflate: Use this for the newer style .docx files and the like; it will decompress the document into a temporary directory.
Using OfficeMalScanner with the switch inflate below, you can see that it decompressed the document and saved it here: C:\Users\REM\AppData\Local\Temp\DecompressedMsOfficeDocument.
You will want to find the file named VBAPROJECT.BIN under the WORD folder and use OfficeMalScanner on it. Note how it says to use the info switch on it.
Two macros have been extracted. You can now check them out with your favorite text editor.