0

So I've been using applescript with Outlook version 16 to automate some tasks. I want to create an email and then save it in the drafts folder but i've been unsuccessful.

I've tried several variations on this (like save newMessage in drafts, etc.) but can't seem to get it to work - dictionary for applescript/outlook hasn't been too helpful either. Perhaps I'm not experienced enough to understand it... I can open the email I create. I can send it from outlook. I just can't save it in drafts.

tell application "Microsoft Outlook"

    set newMessage to make new outgoing message with properties {subject:"Hello I'm an email"}

    set plain text content of newMessage to "Hello World "

    save in drafts

end tell
  • Have you tried: save newMessage in mail folder "Drafts" EDIT- You code actually works for me on my machine with Outlook 2016. Have you tried restarting the machine? – Chris Norman May 31 at 0:36
  • Tried it now. It give me an "Microsoft Outlook got an error: Parameter error." – sfields May 31 at 0:41
  • Yeah sorry, that was me guessing at the right syntax. I was wrong. Buy as I stated, your code worked fine on my computer with Outlook 2016 on it. – Chris Norman May 31 at 0:44
  • It might just some sort of wonky update with the newer version. I appreciate you trying it though. :) – sfields May 31 at 0:58
  • 1
    Solved it. Turns out they were being saved after all. Under preferences, there's a switch to toggle whether or not you can see the "on my computer" folders. When you turn that on, you get the drafts folder and you can see where everything has been saved. When I "send" a message from there, it temporarily goes into the drafts folder of my work email (the one I have set up on my outlook) which is where I thought it was supposed to appear originally. Since the drafts weren't appearing there, I mistakenly assumed they weren't being saved at all.... Sigh.... – sfields May 31 at 20:18

You must log in to answer this question.

Browse other questions tagged .