Macro with Parameter

Hy Folks, I want to know how i can start a Marco(in Word) with Parameters. My Code works, very well but i need a parameter start of the macro. CREATE(wdApp); wdDoc := wdApp.Documents.AddOld(pfad); wdApp.ActiveDocument.Fields.Update; … // Starte Word Macro wdApp.Run(‘MACRO 1’); // How can i give the Macro a parameter ??? wdApp.Visible := TRUE; wdApp.ActiveDocument.Fields.Unlink; CLEAR(wdApp); CLEAR(wdDoc); CLEAR(wdRange); ------------ Best regards Alejandro Schubert alejandro.schubert@cycos.com

When you declare the variable as parameter in the macroname, you can pass the value when calling. Hmmm, a sample is mor clear, I think: Sub Macro1(TxtVar As String) Selection.TypeText Text:=TxtVar End Sub Now should be able to call the macro as wdApp.Run(‘MACRO1(“Hello”)’); (tried in Word, but not from Navision - so no warranty) John

Hi, I did this with EXCEL: wdApp.Run(‘MACRO1’,param1,param2,…); You can use String, Decimal and Integer parameters. Valentin Gvozdev BMI Inc.

It took me 20 Minutes to develop an OCX in Delphi which implements the functions Sin, Cos, Tan, Cotan, ArcSin, ArcCos, ArcTan. I’ll upload the codeunit to www.mynavision.net. It will take something around 1-2 days until you can find it in the download area. Marcus Marcus Fabian phone: +41 79 4397872 m.fabian@thenet.ch