Assuming your macro resides in a template, there isn't any code to be removed from the document. But, since your code is incomplete, missing the vital sub name, I can't tell how it's triggered. The links I posted both show code that will only run of its own accord when a new document is created from the template.
If, however, you're using a document and simply copying it (bad idea), you will have great difficulty in running a macro from that document to delete all macros in the document. After all, as soon as it deletes its own code module, it'll stop running. Apart from that, Word would require trusted access to the VBA project (unwise as a normal setting) and that can't be given programmatically.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
|