使用 applescript 在 Outlook 中创建带有附件的邮件 [英] Create a message with attachment in Outlook using applescript

查看:74
本文介绍了使用 applescript 在 Outlook 中创建带有附件的邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Microsoft Outlook 15.6 版中打开一个新消息窗口并填充包括附件在内的字段.这是我的动作脚本代码:

I'm trying to open a new message window in Microsoft Outloook version 15.6 and populate the fields including an attachment. Here's my actionscript code:

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"}}
make new attachment at the end of newMessage with properties {file:"/tmp/Invoice INV2 - Paul.pdf"}
    open newMessage
end tell

(此消息源自此堆栈溢出问题).

但是,我收到此错误:256:398:执行错误:Microsoft Outlook 出现错误:保存更改的记录属性时出错.(-2700)

However, I get this error: 256:398: execution error: Microsoft Outlook got an error: Error while saving the changed record property. (-2700)

是否可以使用 actionscript 在最新版本的 Outlook 中打开新邮件?

Is it possible to use actionscript to open a new message in the latest version of Outlook?

推荐答案

我找到了解决方案:我需要在脚本前面添加以下行:

I found the solution: I needed to add the following line at the front of the script:

set x to "/Users/foo/file" as POSIX file

查看此页面了解详情:怎么做我是否通过 AppleScript 将文件附加到 Microsoft Outlook 中的新邮件?

这篇关于使用 applescript 在 Outlook 中创建带有附件的邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆