vba的Applescript无法发送邮件

时间:2018-11-25 22:02:29

标签: excel vba applescript

我在Excel中有VBA代码。代码生成applescript并与MacScript(scriptToRun)一起运行。 生成的applescript:

tell application "Mail"
    set NewMail to make new outgoing message with properties {content:"Тестовая Заявка", subject:"Заявка" , visible:true}
tell NewMail
make new to recipient at end of to recipients with properties {address:"myaddress@gmail.com"}
tell content of NewMail
make new attachment with properties {file name:"Macintosh HDD:Users:xxxxx:order_26.11.2018_005345.xlsx" as alias} at after the last paragraph
end tell
activate
delay 3
end tell
Activate
send NewMail
end tell

邮件显示,但不发送。如果我使用MAC脚本编辑器尝试此脚本,一切正常,然后发送邮件。 VBA返回错误5:无效的过程调用或参数

我在哪里错了? PS对不起,英语不好

0 个答案:

没有答案