Explorer.BeforeItemCut Event (Outlook)

Office 2013 and later

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Occurs when an Outlook item is cut from a folder.

expression .BeforeItemCut(Cancel)

expression A variable that represents an Explorer object.




Data Type





False when the event occurs. If the event procedure sets this argument to True, the operation is not completed and the item is not deleted.

This event can be cancelled after it has started. If the event is canceled, then the item will not be removed.

The following Microsoft Visual Basic for Applications (VBA) example prompts the user with a warning message before the item is cut from the folder. If the user clicks Yes, the item is cut from the folder. If the user clicks No, the item will not be removed from the folder. The sample code must be placed in a class module such as ThisOutlookSession, and the Initialize_handler routine must be called before the event procedure can be called by Microsoft Outlook.

Public WithEvents myOlExp As Outlook.Explorer 
Sub Initalize_Handler() 
Set myOlExp = Application.ActiveExplorer 
End Sub 
Private Sub myOlExp_BeforeItemCut(Cancel As Boolean) 
'Prompts the user before cutting an item 
 Dim lngAns As Long 
 'Display question to user 
 lngAns = MsgBox("Are you sure you want to cut the item?", vbYesNo) 
 'Set cancel argument based on user's answer 
 If lngAns = vbYes Then 
 Cancel = False 
 ElseIf lngAns = vbNo Then 
 Cancel = True 
 End If 
End Sub