Could some give me an example of how to get an email address into the “TO:” field in “Microsoft Outlook” via scripting.
tell application “Microsoft Outlook”
CreateMail Recipients {{“someome@somewhere.com”}, {“someoneelse@somewhere.com”}}
end tell
generates an error “Microsoft Outlook got an error: Some parameter is missing for CreateMail.”
The dictionary describes Reciepients as “list of list”
Dictionary:
CreateMail: Create a new mail document
CreateMail
[Subject string]
[Body string]
[Attachments list of list]
[Recipients list of list]
[CC_Recipients list of list]
[BCC_Recipients list of list]
[Display boolean]
Try adding “without Display” at the end of the line and taking out the second level brackets.
tell application "Microsoft Outlook"
CreateMail Recipients {"someome@somewhere.com", "someoneelse@somewhere.com"} without Display
end tell
Thanks Dennis
It works
Dave
I found that just because Outlook threw up an error it didn’t mean that things weren’t being mailed. You might want to check your sent folder. Also, the dictionary is kinda misleading, what with saying that things should be lists of lists when they mean members of lists (and that only if there is more than one recipient which doesn’t need to be a list).
I seem to recall (and cannot for the life of me find out where I had read this) that you have to use the Display property to keep Outlook from complaining.
I chalk it up to not wanting to put too much work into something that will be freely distributed. Of course, we have to pay the CALs, don’t we?
My next project is finding out exactly how to get Mail to work with an Exchange server.