Board index » delphi » How to pass parameters to a Word macro

How to pass parameters to a Word macro

Can anyone give me an sample code of passing parameters to Word macros in
OleAutomation
programming

Thanks

 

Re:How to pass parameters to a Word macro


hi,

you can use the application.run method. This takes up to 30 parameter...

In the the Word VBA helpfile :
Run Method Example

This example prompts the user to enter a template name, module name, macro
name, and parameter value, and then it runs that macro.

t = InputBox("Enter the template name")
md = InputBox("Enter the module name")
m = InputBox("Enter the macro name")
p = InputBox("Enter a parameter value")
Application.Run MacroName:=t & "." & md & "." & m, _
    varg1:=p
regards
-- Peter.van.Ooi...@Gekko-Software.nlhttp://www.Gekko-Software.nl/Delphi

Quote
"Dan Rattanasamay" <dr.y...@wanadoo.fr> wrote in message

news:3bcc3449$1_2@dnews...
Quote
> Can anyone give me an sample code of passing parameters to Word macros in
> OleAutomation
> programming

> Thanks

Other Threads