none
Run outlook vba macro on double click open of an item RRS feed

  • Question

  • Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
         Dim intRes As Integer
     
          
             intRes = MsgBox("save to Acturis?", vbYesNoCancel + vbDefaultButton1)
             Select Case intRes
                       
                 Case vbCancel
                     Cancel = True
                 Case vbYes
                Sendkeys ("%(xy)")
                DoEvents
                 Case vbNo
             End Select
     
    
     End Sub

    Hi all

    I'm wondering if anyone can help me here. My code above makes use of the Itemsend event however it doesn't work when I'm using the send as attachment function from within Excel/Word or where I have attachments generally. The sendkeys purely starts a thirdparty add-in which we do not have access to the objects to call.

    Ideally I'd also like the macro to run whenever the mail item is double clicked to open.

    Thanks for your help in advance!

                     
    Tuesday, June 12, 2012 11:53 AM

All replies

  • "Ideally I'd also like the macro to run whenever the mail item is double clicked to open."

    The above can be achieved if you add an event in Outlook with Inspectors.NewInspector event.Refer to MSDN docs for knowing how to add event in outlook.


    Best Regards,
    Asadulla Javed, Kolkata
    ---------------------------------------------------------------------------------------------
    Please do not forget to click “Vote as Helpful” if any post helps you and "Mark as Answer”if it solves the issue.

    Friday, August 24, 2012 2:47 PM
    Answerer