Showing results for 
Search instead for 
Did you mean: 

Outlook VBA to delete e-mail containing Enterprise Vault shortcut

Level 0

I have built an Outlook VBA macro to delete items matching specific criteria. It works well for normal e-mails, however, if the e-mail contains an Enterprise Vault shortcut, I first get prompted, "You have chosen to delete one or more Enterprise Vault shortcuts". I'd like to eliminate or manage that prompt. However, the bigger issue is that whether I answer "Delete Shortcuts" or "Delete Both", I get a runtime error 287, "Application-defined or Object-defined error."

I can identify the shortcuts with MessageClass = "IPM.Note.EnterpriseVault.Shortcut", however, I don't know how to deal with them to prevent the error. If I had to use VBA code to restore the shortcut, that would be acceptable.


Level 6

You are getting the prompt because of a setting in your Exchange Desktop Policy. On the Options tab there is a setting for "Outlook Behavior > Shortcut Deletion." Set it to something other than "Ask User" and the prompt will stop appearing.


If you set it to "Shortcut Only," then your macro should delete the EV shortcut and leave the archived copy alone.

If you set it to "Both deleted," then the deletion in Outlook should be captured by the EV Add-in, which should send a deletion request to the EV server to delete the archived copy of the item too. I have no idea if this "Both deleted" functionality works properly with deletions initiated programmatically; it's really designed for individual user deletions.