Conversation.GetAlwaysDelete method (Outlook)

Returns a constant in the OlAlwaysDeleteConversation enumeration that indicates whether all new items that join the conversation are always moved to the Deleted Items folder in the specified delivery store.

Syntax

expression. GetAlwaysDelete( _Store_ )

expression A variable that represents a 'Conversation' object.

Parameters

Name Required/Optional Data type Description
Store Required Store Specifies the store that holds the Deleted Items folder to which items of the conversation are moved.

Return value

A constant from the OlAlwaysDeleteConversation enumeration that indicates whether all new items of the conversation are always moved to the Deleted Items folder of the specified delivery store.

Remarks

If the Store parameter specifies a non-delivery store such as an archive .pst store, the GetAlwaysDelete method returns a constant from OlAlwaysDeleteConversation that applies to conversation items in the default delivery store. Items on a non-delivery store are not moved to the Deleted Items folder for the default delivery store.

If GetAlwaysDelete returns olAlwaysDelete, items of the conversation are always moved to the Deleted Items folder for the store that contains the items. In a cross-store conversation, items are moved to the Deleted Items folder for the store that contains the items. When GetAlwaysDelete returns olAlwaysDelete, the GetAlwaysMoveToFolder method returns a folder object that represents the Deleted Items folder for the default store.

If GetAlwaysDelete returns olAlwaysDeleteUnsupported, the specified store does not support the action of always moving items to the Deleted Items folder of that store.

If GetAlwaysDelete returns olDoNotDelete, new items that arrive in 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.

Example

The following Microsoft Visual Basic for Application (VBA) example shows how to verify the always-delete setting of the conversation of a selected mail item. The code example, DemoGetAlwaysDelete, verifies that conversations are enabled in the default store, obtains the conversation that involves the first mail item displayed in the Reading Pane if a conversation exists, uses GetAlwaysDelete to obtain the always-delete setting, and displays the setting.

Sub DemoGetAlwaysDelete() 
 
 Dim oMail As Outlook.MailItem 
 
 Dim oConv As Outlook.Conversation 
 
 Dim oStore As Outlook.Store 
 
 Dim intValue As Integer 
 
 
 
 ' Get the item displayed in Reading Pane. 
 
 Set oMail = ActiveExplorer.Selection(1) 
 
 
 
 If Application.Session.DefaultStore.IsConversationEnabled Then 
 
 Set oConv = oMail.GetConversation 
 
 If Not (oConv Is Nothing) Then 
 
 intValue = _ 
 
 oConv.GetAlwaysDelete(Application.session.DefaultStore) 
 
 If intValue = _ 
 
 Outlook.OlAlwaysDeleteConversation.olAlwaysDelete Then 
 
 Debug.Print "olAlwaysDelete" 
 
 ElseIf intValue = _ 
 
 Outlook.OlAlwaysDeleteConversation.olAlwaysDeleteUnsupported Then 
 
 Debug.Print "olAlwaysDeleteUnsupported" 
 
 ElseIf intValue = _ 
 
 Outlook.OlAlwaysDeleteConversation.olDoNotDelete Then 
 
 Debug.Print "olDoNotDelete" 
 
 End If 
 
 End If 
 
 End If 
 
End Sub

See also

Conversation Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.