Search code examples
outlookexchange-servermessage

Is there a way to programmatically recall e-mails via Outlook/Exchange?


Does anyone know if this is possible? I can't see to find much info about doing so other than to even recall a message both sender & receiver must be using Exchange and the e-mail has to be unread on the receiver's end. There's rarely a case where this would need to be done but even so it would be useful to know.

Edit

  • Outlook 2010 is the version I am using.

Solution

  • The FindControl ID for "Recall This Message" is 2511, so you could use some code like this:

    Sub SendRecall()
    
      Dim obj As Object
      Dim msg As Outlook.mailItem
      Dim insp As Outlook.Inspector
    
      ' get selected item
      Set obj = ActiveExplorer.Selection.item(1)
    
      If TypeName(obj) = "MailItem" Then
        Set msg = obj
        Set insp = msg.GetInspector
        ' execute the command button for "Recall this message"
        With insp
          .Display
          .CommandBars.FindControl(, 2511).Execute
          .Close olDiscard
        End With
      End If
    End Sub
    

    Works in Outlook 2003, you did not post your version so I'm not sure if this solution will work for you.