8

I'm trying to create a new outgoing message with Microsoft Outlook 2011 for mac, using AppleScript. The following example worked in 10.6.8:

tell application "Microsoft Outlook"
    set newMessage to make new outgoing message with properties {subject:"Hooray for automation"}
    make new recipient at newMessage with properties {email address:{name:"Jim Shank", address:"jim.shank@example.com"}}
    open newMessage
end tell

On Lion I'm getting the following error:

Microsoft Outlook got an error: Can’t make class outgoing message.

Does anybody have a clue what went wrong there?

I'm using offline Outlook.

Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
  • Apparently in more recent versions of Outlook one needs to use 'to recipient' or 'cc recipient' or 'bcc recipient' on the third line of the script. – Von Oct 02 '20 at 20:40

2 Answers2

3

Apparently, I'm using a trial version, that has expired. With registered version this script works perfectly. Boo Outlook...I spent on looking into this a couple of hours!

Nava Carmon
  • 4,523
  • 3
  • 40
  • 74
0
tell application "Microsoft Outlook"
    set newMessage to make new outgoing message with properties {subject:"Hooray for automation"}
    make new recipient at newMessage with properties {email address:{name:"Jim Shank", address:"jim.shank@example.com"}}
    send newMessage
end tell

This way, it will automatically send it.

Laurel
  • 5,965
  • 14
  • 31
  • 57
Ko Kane
  • 11