Re: triggering macros with parameters
From: Chad DeMeyer (cjdemeye_at_bechtel.com)
Date: 05/25/04
- Next message: Chad DeMeyer: "Re: How to prevent edit"
- Previous message: Chad DeMeyer: "Re: Office and its Service Packs versions"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 25 May 2004 11:20:57 -0700
Jake,
The Run method of the Application object in Word will accept up to 30
parameters. E.g.,
WD.Run "Project.Module1.Macro1", arg1, arg2, ... arg30
where arg1, arg2, etc. are the parameters you wish to send to the procedure
or function. Of course, those parameters need to be defined in the
declaration, e.g.,
Sub MySub(param1 as String, param2 as Integer, ... param30 as Object)
Hope this helps.
Regards,
Chad
"Jake Williams" <anonymous@discussions.microsoft.com> wrote in message
news:2c5a01c42877$1f602370$a501280a@phx.gbl...
> Is it possible to trigger a macro with parameters using
> vbScript? If so, could you please post the code or
> provide a link to the information.
> Here is what I am doing thus far...but it will not work
> if I have parameters.
>
> Dim WD
> Set WD = CreateObject("Word.Application")
> WD.Documents.Open "C:\word.Doc"
> WD.Run "Project.Module1.Macro1"
> WD.Close
- Next message: Chad DeMeyer: "Re: How to prevent edit"
- Previous message: Chad DeMeyer: "Re: Office and its Service Packs versions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|