BeforeItemMove item object does not resolve to Outlook.MailItem

Add-in Express™ Support Service
That's what is more important than anything else

BeforeItemMove item object does not resolve to Outlook.MailItem
 
Steve Obarowski




Posts: 16
Joined: 2017-01-24
I apologize, the original post was mistaken. The item being dragged was actually a document. I do have several other questions, however.

1) Why do certain email items fire the BeforeItemMove event while others fire the ProcessItemChange event? It seems that any folder on the same level as Inbox (with the exception of Deleted Items) fires BeforeItemMove, while any folder at level 2 or below fires the ProcessItemChange. It wouldn't be a big deal, but the ProcessItemChange event can take upwards of 20 seconds to fire. When you're waiting for a popup window, that seems like an eternity.

2) If I select multiple emails and drop on my folder, how is that best handled in the event handler? What structure is in the item parameter?
Posted 26 May, 2017 16:45:41 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Steve,

#1. I suppose you have some issues in code. I suggest that you download, rebuild, and register the add-in we describe at https://www.add-in-express.com/creating-addins-blog/2010/07/01/outlook-events-tool/.

#2. You can handle that operation from two sides: 1) you can intercept the BeforeItemMove event of the Items collection of the folder *from* which the items are moved and 2) you can intercept the ItemAdd event of the Items collection of the folder *to* which the items are moved.

Steve Obarowski writes:
What structure is in the item parameter?


What event? I suggest that you add a reference to Microsoft.VisualBasic and call System.Diagnostics.Debug.WriteLine(Microsoft.VisualBasic.Information.TypeName(item)).

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 May, 2017 06:07:14 Top