wodImapServer ActiveX Component - MoveMessage Event
    
 

Description

Fires when user wants to move message to other folder.


Syntax

Private Sub object_MoveMessage(User, Folder, Message, Destination, Action)



The MoveMessage Event syntax has these parts:

Part Description
object A wodImapServer object.
User An ImapUser object. Reference to user what wants to move the message.
Folder An ImapFolder object. Reference to folder that contains message that is to be moved.
Message An ImapMessage object. Reference to message that should be moved.
Destination An ImapFolder object. Reference to destination folder that will receive the message.
Action An ImapActions enumeration, as described in settings. Return value you should fill with either Allow or Deny value, depending if you will allow user to move message or not.

Settings

The settings for Action are:

Constant Value Description
 Deny 0 Deny execution of the action.
 Allow 1 Allow to execute action.

Remarks
This event is fired when user decides to move the message from one folder to another. Typical example would be when user wants to move some message to Trash folder. You can allow this message by setting Action = Allow, or deny it.

If you decide you will allow message to be moved, you should:

1. Remove reference to message from origination folder
2. Add reference to message to destination folder
3. Physically move message from one location to another - if your code works that way
4. Update (or check) if Message.UID is set
5. Set Action = Allow

Moving messages is easy because (depending on your code) you should only move references, not the actual contents. Don't forget to store Message.Flags if necessary - they are not changed when you move message.

Message.UID should be changed when message is moved to new folder. This will be done automatically by wodImapServer (using Folder.NextMessageUID property) but you can also override that setting using some value from your storage.