Trapping message move operations

X

xyz250

Hi all,

I've been struggling with a unique issue for a couple days and hope
someone can assist. I have a requirement to trap all message move
operations when a user moves messages to folders outside the mailbox,
i.e. to a public folder or another mailbox. Essentially, the add-in
will be responsible for displaying a message box stating that this
type of operation is not valid.

I've placed my code in the exlporer's BeforeItemPaste event, but so
far the event only fires when a message move is initiated via a drag
and drop method, or if the Cut and Paste functions on the Edit menu
are utilized. If the Move to folder function on the Edit menu, the
right-click context menu or the Move to folder button on the exlporer
and inspector tool bars are used, the BeforeItemPaste item does not
fire.

Does anyone have any ideas as to how I trap messages moved using the
above methods? Any insight is appreciated.

Thanks,

Chris
 
K

Ken Slovak - [MVP - Outlook]

You'd have to handle the MAPIFolder.Items.ItemAdd event on any possible
folder where the user could move items. ItemRemove on the
ActiveExplorer.CurrentFolder.Items collection wouldn't help it fires after
the removal of an item and can't be canceled and doesn't tell you where an
item was moved.

You might want to consider disabling the menu buttons that allow the
move/copy operations and substituting your own buttons and therefore having
control over moves/copies, but that would be only a partial solution since
the user could still move or copy items using the Navigation Pane.
 
X

xyz250

Thanks for your response Ken. I don't think I can take the approach
of handling the MAPIFolder.Items.ItemAdd event because of the sheer
number of potential folders the user could move the message to. I
kind of like the idea of disabling the buttons on the toolbar and
subsituting my own, but like you said, there are other ways to copy/
move messages. It looks like I will not be able to provide the
functionality I need, at least not in an add-in. Thanks again for
your help.

Chris

You'd have to handle the MAPIFolder.Items.ItemAdd event on any possible
folder where the user could move items. ItemRemove on the
ActiveExplorer.CurrentFolder.Items collection wouldn't help it fires after
the removal of an item and can't be canceled and doesn't tell you where an
item was moved.

You might want to consider disabling the menu buttons that allow the
move/copy operations and substituting your own buttons and therefore having
control over moves/copies, but that would be only a partial solution since
the user could still move or copy items using the Navigation Pane.

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm




I've been struggling with a unique issue for a couple days and hope
someone can assist. I have a requirement to trap all message move
operations when a user moves messages to folders outside the mailbox,
i.e. to a public folder or another mailbox. Essentially, the add-in
will be responsible for displaying a message box stating that this
type of operation is not valid.
I've placed my code in the exlporer's BeforeItemPaste event, but so
far the event only fires when a message move is initiated via a drag
and drop method, or if the Cut and Paste functions on the Edit menu
are utilized. If the Move to folder function on the Edit menu, the
right-click context menu or the Move to folder button on the exlporer
and inspector tool bars are used, the BeforeItemPaste item does not
fire.
Does anyone have any ideas as to how I trap messages moved using the
above methods? Any insight is appreciated.

Chris- Hide quoted text -

- Show quoted text -
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top