Outlook script to remove a message from the POP server

cooper_mac asked on
I had this script in Entourage 2004/2008 and used it heavily. It doesn't work in Outlook 2011. The script designates a selected message to be deleted from the POP server, marked as "read" and moved to the Deleted Items folder. When run in Outlook 2011 (v.14.1.2), it returns the following:

Script error:  Microsoft Outlook got an error:  Can't set «class cnAc» of incoming message id 25126 to «constant eCnAcaRm».  <OK>

Does anyone script fluently enough to fix this script so it works in Outlook 2011? 

Here's the non-working script: 

tell application "Microsoft Outlook"

set winlist to every window

set msglist to current messages

set idList to {}

repeat with aMsg in msglist

copy id of aMsg to end of idList

end repeat

repeat with thewin in winlist

if class of thewin is «class cInW» then

if (id of «class pMsg» of thewin) is in idList then close thewin

end if

end repeat

repeat with theMsg in msglist

set «class cnAc» of theMsg to «constant eCnAcaRm»

set «class rdst» of theMsg to «constant Erdsread»

move theMsg to «class pDlM»

end repeat

end tell

1 person had this question

Abuse history

The answered status icon Answer
dianeoforegon replied on
Reply from Script Outlook list by Barry Wainwright.

you're out of luck - partly.

There is no 'delete from server' applescript command in Outlook, so you can't do that bit. However, if the account i set up so that messages are deleted from server when deleting in outlook, then this step is not required. All you need to do then is delete the message - marking it as 'read' doesn't achieve anything other than reduce the 'unread' count on the deleted items folder. Any saved searches can be updated to exclude the deleted items folder from their search rests, so that it shouldn't matter that there are unread messages in there until you empty the deleted items folder.

so, no script needed at all - just select the message(s) and hit the delete key!
Be the first person to mark this helpful

Abuse history