• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Q: Passing values to VBA macros (Word 98)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Q: Passing values to VBA macros (Word 98)
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: select a startup disc
  • Next by Date: re: mount volume & netatalk (was Re: Mount volume, slash problem)
  • Previous by thread: Re: copying a list of files
  • Next by thread: Re: Q: Passing values to VBA macros (Word 98)
  • Index(es):
    • Date
    • Thread