How to delete winword macros attaches to documents

Hi,
I have a problem with some winword documents that have some macros attaches to the documents. Thes macros are in conflict with macros of the normal.dot. I Have a lot of doc files to verify.
Do you know if it's possible to write a VBA macro to open all then winword documents and to delete all macros attached to the documents ?

thanks
CBADETAsked:
Who is Participating?
 
GrahamSkanConnect With a Mentor RetiredCommented:
If the code is in the document, you can delete it with the OrganizerDelete method
    Application.OrganizerDelete "C:\MyFolder\MyFile.doc", "Module1", wdOrganizerObjectProjectItems

Open in new window

0
 
GrahamSkanRetiredCommented:
First of all, are you sure that the macros are in the document?  The usual way for Word to work is to have the macros in a Template. When a document created from the Template, the macros are not transferred to the document, but are available because the template is attached , so changing the attached template to Normal will break the link.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.