2015-06-01 63 views
9

Sto tentando di aprire una nuova finestra di messaggio in Microsoft Outloook versione 15.6 e compilare i campi incluso un allegato. Ecco il mio codice ActionScript:Creare un messaggio con allegato in Outlook usando 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 

(Questo messaggio è stato derivato da this stack overflow question).

Tuttavia, viene visualizzato questo errore: 256: 398: errore di esecuzione: Microsoft Outlook ha ricevuto un errore: Errore durante il salvataggio della proprietà del record modificata. (-2700)

È possibile utilizzare actionscript per aprire un nuovo messaggio nell'ultima versione di Outlook?

+2

Eventuali duplicati di [Come fare Allego un file a un nuovo messaggio in Microsoft Outlook tramite AppleScript?] (Http://stackoverflow.com/questions/32052438/how-do-i-attach-a-file-to-a-newewmessage-in- Microsoft-Outlook-via-AppleScript) – Mogsdad

risposta

1

Di seguito è riportato un codice a barre; forse ti aiuterà?

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 
Problemi correlati