This PS script will extract macro from Excel and Word files. Also checks the macro for suspecious code patterns Includes temporary DDE check for word documents
The method of opening the file in it's native format and attempting to interact via the VBE can lead to compromise of the host computer performing the extraction.
A big use case for extracting macros on the command line is to avoid exploitation.
It should be noted that this tool is not fit for that purpose.