Programmatically replace code in VBA module in multiple MS Word documents.
Posted on 2007-04-03
Microsoft Word. VB/VBA
I would like to write a piece of code that finds all MS Word documents in a specific folder, and changes the code in the VBA attached to the documents. I.e. I would like to change the code in a series of documents rather than having to open each document individually, open the VBA, select all, paste new code, save document (there are hundreds of documents!)
Each document will have a module called "Save_Form" in it's VBA. It is the code in this modulte that needs changing. The changed code can come from a flat file, or even the current file (if written in VBA).
Is it even possible using the MSApplication or Word object to alter the VBA code?
Any help appreciated. Thanks.