I have a macro in a template that I can manually run using the Tools-
Macros menu option. In the VBA editor though when I try and expand
the document it's from in the project pane I get a messagebox titled
"Project Locked" with a message of "Project is unavailable". I tried
manually writing the code to run it, but get an error 424.

ProjectName.ThisDocument.MacroName

Re: How can I call a macro from an unviewable project by Jonathan

Jonathan
Fri Oct 19 08:43:21 PDT 2007


"Dan Neely" <dan.neely@gmail.com> wrote in message
news:1192808233.455079.9130@v23g2000prn.googlegroups.com...
>I have a macro in a template that I can manually run using the Tools-
> Macros menu option. In the VBA editor though when I try and expand
> the document it's from in the project pane I get a messagebox titled
> "Project Locked" with a message of "Project is unavailable". I tried
> manually writing the code to run it, but get an error 424.
>
> ProjectName.ThisDocument.MacroName
>

Use the Application.Run method. Provided that you know the name of the
routine, and the routine is Public, you can run it.


--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup



Re: How can I call a macro from an unviewable project by Dan

Dan
Fri Oct 19 09:59:18 PDT 2007

On Oct 19, 11:43 am, "Jonathan West" <jw...@mvps.org> wrote:

> Use the Application.Run method. Provided that you know the name of the
> routine, and the routine is Public, you can run it.

Ok. I know the document name. I know the macroname and can run it
from the Tool-Macros dialog (I assume this means it's public). How
can I find out what module it's contained in? Is there a way to do it
through word, or do I need to the vendor that provided it in the first
place?


Re: How can I call a macro from an unviewable project by Dan

Dan
Fri Oct 19 10:19:15 PDT 2007

On Oct 19, 12:59 pm, Dan Neely <dan.ne...@gmail.com> wrote:
> On Oct 19, 11:43 am, "Jonathan West" <jw...@mvps.org> wrote:
>
> > Use the Application.Run method. Provided that you know the name of the
> > routine, and the routine is Public, you can run it.
>
> Ok. I know the document name. I know the macroname and can run it
> from the Tool-Macros dialog (I assume this means it's public). How
> can I find out what module it's contained in? Is there a way to do it
> through word, or do I need to the vendor that provided it in the first
> place?

I managed to guess the module name, but am still interested in knowing
if there's a more foolproof approach.


Re: How can I call a macro from an unviewable project by Jonathan

Jonathan
Fri Oct 19 10:24:41 PDT 2007


"Dan Neely" <dan.neely@gmail.com> wrote in message
news:1192813158.409957.94820@v23g2000prn.googlegroups.com...
> On Oct 19, 11:43 am, "Jonathan West" <jw...@mvps.org> wrote:
>
>> Use the Application.Run method. Provided that you know the name of the
>> routine, and the routine is Public, you can run it.
>
> Ok. I know the document name. I know the macroname and can run it
> from the Tool-Macros dialog (I assume this means it's public).

Correct.

> How
> can I find out what module it's contained in? Is there a way to do it
> through word, or do I need to the vendor that provided it in the first
> place?
>

Provided the macro name is unique, you don't need the module name. If the
macro name is not unique, it is qualified by the module name (and if
necessary, the project name & template name) when displayed within the Tools
Macro dialog.


--
Regards
Jonathan West