wodImapServer ActiveX Component - MoveFolder Method
      
 

Description

Called when user wants to move folder to another parent.


Return Type

None  


Syntax

object.MoveFolder Owner, User, ParentFolder, Folder, DestinationFolder, DestinationName, Action



The MoveFolder Method syntax has these parts:

Part Description
object An expression evaluating to an object of type IwodImapNotify.
Owner Required. A wodImapServer object.
User Required. An ImapUser object. Reference to user who wants to move folder.
ParentFolder Required. An ImapFolder object. Reference to parent folder that contains folder that will be moved.
Folder Required. An ImapFolder object. Reference to folder that will be moved.
DestinationFolder Required. An ImapFolder object. Reference to destination folder. (This will become new parent folder.)
DestinationName Required. A String value. New name for the folder once it is moved.
Action Required. 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 folder 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
NOTE: This method is called only if you implemented IwodImapNotify interface in your application, and wodImapServer1.Notification property has received reference to instance of your implementation.
 
Typical action user will do while working with his mail is to move specific folder to Trash. Of course, that is not the only way, but it will be most common. When he does that, this notification method is called so you can decided if you will allow this action or not. If you don't want folder to be moved, set Action = Deny.

If you decide to allow folder to be moved, you should:

1. Remove referenced folder from collection stored in ParentFolder
2. Add referenced folder to collection in DestinationFolder
3. Update Folder.Name as defined in DestinationName
4. Set Action = Allow

Depending on your implementation - you might also have to physically move folder contents to new location.

When folder is moved his UID is changed - so update it also.