2015-06-01 18 views
9

Tôi đang cố mở một cửa sổ thư mới trong Microsoft Outloook phiên bản 15.6 và điền vào các trường bao gồm phần đính kèm. Dưới đây là mã hành động của tôi:Tạo thư có tệp đính kèm trong Outlook bằng cách sử dụng applescript

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

(Thông điệp này có nguồn gốc từ this stack overflow question).

Tuy nhiên, tôi gặp phải lỗi này: 256: 398: lỗi thực hiện: Microsoft Outlook gặp lỗi: Lỗi khi lưu thuộc tính bản ghi đã thay đổi. (-2700)

Có thể sử dụng ActionScript để mở thư mới trong phiên bản Outlook mới nhất không?

+2

có thể trùng lặp của [Làm thế nào để Có thể đính kèm tệp vào thư mới trong Microsoft Outlook qua AppleScript không?] (Http://stackoverflow.com/questions/32052438/how-do-i-attach-a-file-to-a-new-message-in- microsoft-outlook-via-applescript) – Mogsdad

Trả lời

1

Đây là một bản ghi chép; có lẽ nó sẽ giúp?

tell application "Microsoft Outlook.app" 
activate 
set theFile to "Macintosh HD:Users:Shared:sp.zip" 
set newMessage to make new «class outm» with properties {«class subj»:"Outlook is back"} 
make new «class rcpt» at newMessage with properties {«class emad»:{name:"Mark", «class radd»:"[email protected]"}} 
tell newMessage 
    set theAttachment to make new «class cAtc» with properties {file:theFile} 
    «event mailsend» 
end tell 
end tell 
Các vấn đề liên quan