Q: Passing values to VBA macros (Word 98)
Q: Passing values to VBA macros (Word 98)
- Subject: Q: Passing values to VBA macros (Word 98)
- From: email@hidden (Frank Watzl)
- Date: Wed, 14 Feb 2001 20:47:49 +0100
Hi, I have tried to figure this one out for three days now. I really hope
that somebody can help me, please.
In a Word 98 Document, which is currently open in Word's frontmost window,
there are three VBA subroutines:
Sub runner()
MsgBox "keep on running"
End Sub
Sub Passer(theParam)
MsgBox theParam
End Sub
Sub caller()
Call Passer("Caller did this call")
End Sub
From AS, I can
--+++++
tell application "Word"
do script "runner()"
end tell
--+++++
Runner's msgBox is displayed properly. Now, I want to pass a string to the
VBA subroutine named "Passer(theParam)". This doesn't work :-(
tell application "Word"
do script "Passer(\"Applescript did this call\")"
end tell
What I get is a VBA Code window opening, displaying
Sub TmpDDE()
Passer__ ("Applescript did this")
End Sub
accompanies by a dialog saying "Sub or Function not defined".
How can I successfully pass Parameters to a VBA sub?
Thanks,
Frank Watzl