Import module with code

M

Mark

I am using Word 97 and I want to be able to automatically
import a VBA module into an existing template. Is this
possible? Also if a module exists in the templste with
the same name it writes over the exisitng one. If so,
could someone please assist me with code to achieve this?

Thanks

Mark
 
J

Jezebel

At its simplest:

application.VBE.ActiveVBProject.VBComponents.Import FileName:=Mymodule

This works for W2000, anyway. Explore Help and the ObjectBrowser for how to
specify specific templates and projects.
 

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