I have been asked to "clean up" existing Word templates that have VBA code in them. Basically what I need to do is to remove the old code that is currently in the ThisDocument class module of the template and replace it with the new code.
I've exported the "good" code to a .bas file and I have worked out how to import it back into the Word Template but the only problem I have is that I am importing it as a new module and the original code for the template is stored in the ThisDocument module. I don't know how to either clear the ThisDocument module programmatically (using VBA) or how to replace the contents of it with the "good" code.
There are hundreds and hundreds of these templates and I am looking for the quickest and easiest solution as I am only new to the whole VBA world.
Any help greatly appreciated.
Thanks in advance.
SIobhan