Outlook for Mac

Need help troubleshooting Applescript- Move currently selected Outlook Mssg to a Folder

Unanswered 0 answers

Older post from April 29, 2015. Details may be out of date.

Question asked on Apr 29, 2015

Hello,

Any help troubleshooting will be greatly appreciated. I'm trying to write a simple script in Applescript that takes the currently selected Outlook Message and moves it to an Outlook Folder called TEST. I'm on Outlook for Mac 2011 Ver 14. Here's the code.

*******************************************

tell application "Microsoft Outlook"
    activate
    set msgSet to current messages
    if msgSet = {} then
        error "No messages selected. Select at least one message."
        error -128
    end if
    set theMsg to item 1 of msgSet
    set theAccount to account of theMsg
    set archiveFolder to folder "TEST" of on my computer
    repeat with aMessage in msgSet
        move aMessage to archiveFolder
    end repeat
end tell

*******************************************

When I run this script I get an error as follows.

AppleScript Error

Microsoft Outlook got an error: Cant get folder "TEST" of on my computer.

It looks like the script can't see the folder. Here's what my folder hierarchy looks like in Outlook:

Any ideas on how to resolve this? Thanks!

No answers yet

Write an answer

Your email address will not be published. Please never post passwords.

This site uses Akismet to reduce spam. Learn how your comment data is processed.