Conversation.SetAlwaysMoveToFolder (Outlook)

Sets a Folder object that indicates the folder to which all existing conversation items and new items that arrive in the conversation are always moved.

The SetAlwaysMoveToFolder method operates on conversation items in the delivery store specified by the Store parameter. If the Store parameter represents a non-delivery store such as an archive .pst store, the move action will apply to conversation items in the default delivery store. If the MoveToFolder parameter specifies an invalid folder that does not exist, has been moved, or is read-only, Outlook will raise an error. To stop the always-move-to-folder action for conversations items in a store, call the StopAlwaysMoveToFolder method.

SetAlwaysMoveToFolder (MoveToFolder, Store)


Sub DemoSetAlwaysMoveToFolder() 
 Dim oMail As Outlook.MailItem 
 Dim oConv As Outlook.Conversation 
 Dim oStore As Outlook.Store 
 Dim oFolder As Outlook.Folder 
 
 ' Obtain a reference to the folder where conversation items will be moved. 
 Set oFolder = _ 
 Application.Session.GetDefaultFolder(olFolderInbox).Folders("1-Reference") 
 ' Get the Item displayed in the Reading Pane. 
 Set oMail = ActiveExplorer.Selection(1) 
 Set oStore = oFolder.Store 
 If oStore.IsConversationEnabled Then 
 Set oConv = oMail.GetConversation 
 If Not (oConv Is Nothing) Then 
 oConv.SetAlwaysMoveToFolder oFolder, oStore 
 End If 
 End If 
End Sub

Arguments

The following arguments are required:

MoveToFolder (MAPIFolder) - Specifies the folder to which all existing items and new items that arrive in the conversation are always moved.

Store (Store) - Specifies the store that contains the folder to which items of the conversation are moved.