I need to programatically replace VBA code in 6500 Word documents. Any
advice on how to go about this?
<<Ok, I have written a routine that opens a word document and removes
the vba code. It then addes the vba from a text file.
The new problem is that many, if not all of the documets have the code
protected. Is there a way to progamatically unprotect the project, run
the code and, protect it again?>>
In a word, no.
But you can instead create a new document (using the Documents.Add method)
based on the template. The document contains no code and is unprotected. You
can add all the code you want to that and then save it as a template. But
there isn't any way of protecting the project by code.