Conversation.SetAlwaysDelete (Outlook)
Specifies a setting for the specified delivery store that indicates whether all existing items and all new items that arrive in the conversation are always moved to the Deleted Items folder in the specified delivery store.
The SetAlwaysDelete method operates on conversation items in the delivery store specified by the Store parameter. If the store specified by the Store parameter represents a non-delivery store such as an archive .pst store, the action is applied to conversation items in the default delivery store. If the AlwaysDelete parameter is olAlwaysDelete, conversation items are moved to the Deleted Items folder for the specified store. In this case, the items are not permanently deleted, unless the user has specified a separate option to permanently delete items when Microsoft Outlook shuts down. If SetAlwaysDelete returns olDoNotDelete, existing conversation items and new items that arrive in the conversation are not moved to the Deleted Items folder in the specified delivery store, and existing conversation items in the Deleted Items folder are moved to the Inbox.
SetAlwaysDelete (AlwaysDelete, Store)
Sub DemoSetAlwaysDelete()
Dim oMail As Outlook.MailItem
Dim oConv As Outlook.Conversation
Dim oStore As Outlook.Store
' Get the item displayed in the Reading Pane.
Set oMail = ActiveExplorer.Selection(1)
Set oStore = oMail.Parent.Store
If oStore.IsConversationEnabled Then
Set oConv = oMail.GetConversation
If Not (oConv Is Nothing) Then
oConv.SetAlwaysDelete _
olAlwaysDelete, oStore
End If
End If
End Sub
Arguments
The following arguments are required:
AlwaysDelete (OlAlwaysDeleteConversation) - A constant that indicates whether all existing and new items that arrive in the conversation are always moved to the Deleted Folder of the store specified by the Store parameter.
Possible return values are olAlwaysDelete - New items of the conversation are always moved to the Deleted Items folder for the store that contains the items, olAlwaysDeleteUnsupported - The specified store does not support the action of always moving items to the Deleted Items folder of that store, olDoNotDelete - New items joining the conversation are not moved to the Deleted Items folder on the specified delivery store, and existing conversation items in the Deleted Items folder are moved to the Inbox.
Store (Store) - Specifies the store that contains the Deleted Items folder to which existing and new items of the conversation are to be moved.