replace VBA code Word

L

Liakamai

I need to programatically replace VBA code in 6500 Word documents. Any
advice on how to go about this?
 
L

Liakamai

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?

Thanks in advance ;-D
 
J

Jonathan West

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.
 
R

ReplaceMagic

Do you have passwords for documents?
If you have there is one application (www.replacemagic.com) which can
open document(s) with given password and make changes in your VBA
code.

Hope that this helps (at least it helped me for my documents migration
project).

Best regards,
Mario
 
L

Liakamai

Do you have passwords for documents?
If you have there is one application (www.replacemagic.com) which can
open document(s) with given password and make changes in your VBA
code.

Hope that this helps (at least it helped me for my documents migration
project).

Best regards,
Mario








- Show quoted text -

Thanks for the lead. Fully appreciated!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top