In the following code the method to press the Resend Button ["objInsp.CommandBars.FindControl(, 3165)"] no longer works. What is the new way?
Outlook 2013 VBA Code:
'From jpsoftwaretech.com (no copyright as of 2012-02-10) Dim myItem As Outlook.MailItem Dim objInsp As Outlook.Inspector Dim objActionsMenu As Office.CommandBarControl Dim olNewMailItem As Outlook.MailItem On Error Resume Next Select Case TypeName(Application.ActiveWindow) Case "Explorer" Set myItem = ActiveExplorer.Selection.Item(1) myItem.Display Case "Inspector" Set myItem = ActiveInspector.CurrentItem Case Else End Select On Error GoTo 0 If myItem Is Nothing Then GoTo exitproc 'Resend Message, which opens in a new windows Set objInsp = ActiveInspector Set objActionsMenu = objInsp.CommandBars.FindControl(, 3165) objActionsMenu.Execute 'Get the new Window Set olNewMailItem = ActiveInspector.CurrentItem
When this code runs, objActionsMenu.Execute results in a run-time error '91': "Object Variable or With block variable not set".
I also tried the following which produced the same error:
Set objActionsMenu = objInsp.CommandBars.FindControl(, , "Resend This Message") objActionsMenu.Execute
Thanks!