Accessing a Word macro that resides in an inactive document?

D

dave.mcmanus

Hi,

I'm very new to VBA in Word so I hope my question doesn't sound too
ridiculous. I have a word document that contains a form and I have a
macro that will strip the information out of the form and load it into
an access database.

The Word form will be sent to a large number of external parties for
them to complete and return. I don't want the macro to sit in this
document as many of the recipients will be fairly IT illiterate and a
macro security pop-up might freak them out! Ideally when the returns
come back I would like to open each one and run the macro that would
be sitting in a separate Word Document (which would be open but
inactive).

If I was doing this in Excel I know it wouldn't be a problem as I
could run a macro from an inactive workbook in the active workbook,
but in Word it seems that I can't access a macro if the document it is
in is inactive.

Does anyone know a solution to my problem?
 
J

Jay Freedman

Hi Dave,

The key idea here is to put the macro into a template, and not in _any_
document. (This is different from Excel, where macros routinely go into
worksheets.) The template stays on your computer and never gets sent to
anyone else. Store it in the folder %appdata%\Microsoft\Word\Startup. That
makes it an add-in, and its macros will be available whenever you start
Word -- but they won't be available to any other computer.

When you receive a completed form document, open it. The macro from the
add-in will be ready to run.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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