• 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
Passing variable to MS Word Macro
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Passing variable to MS Word Macro


  • Subject: Passing variable to MS Word Macro
  • From: "Steve Suranie" <email@hidden>
  • Date: Tue, 25 Feb 2003 15:24:49 -0500
  • Thread-topic: applescript-users digest, Vol 3 #1378 - 14 msgs

I'm trying to pass the value of a variable to a MS Word Macro. I can send a string but not a variable:

tell application "Microsoft Word"
activate
do Visual Basic "dnwMSWMacro \"Hello, World!\""
end tell

Here's the macro:

Sub dnwMSWMacro(thisMessage)
'
' dnwMSWMacro Macro
' Macro recorded 2/25/03 by Advance News Magazines
'
MsgBox thisMessage
End Sub

But when I go to do something like this:

set magName to "Advance for Audiologists"
tell application "Microsoft Word"
activate
do Visual Basic "dnwMSWMacro magName
end tell

it bombs. I've tried variations on the syntax with no luck, backslash, no blackslash, quotes, no quotes, etc. I'm sure its just a syntax issue so if someone could point me in the right direction I'd be eternally grateful. (At least till my next problem arises) : )

Thanks

Steve
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Script speed [Was list number]
  • Next by Date: Re: settle! was Re: Scripting Mail:get selection
  • Previous by thread: Re: Script speed [Was list number]
  • Next by thread: Re: Passing variable to MS Word Macro
  • Index(es):
    • Date
    • Thread