Create new outgoing message with applescript in Microsoft Outlook

余生颓废 提交于 2019-12-01 01:21:45

问题


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.


回答1:


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!




回答2:


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.



来源:https://stackoverflow.com/questions/9521897/create-new-outgoing-message-with-applescript-in-microsoft-outlook

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!