Hi could someone help?
I have a Add-in in Outlook (Newforma) that uses the Application_ItemSend function. You can send an email by clicking on Outlooks Send button or on this Addins button.
I wanted to write a small msgbox to remind people to use the Addin when they click on Outlook's Send button.
However because both these buttons trigger the Application_ItemSend my macro runs regardless which button I click.
I need a way to only trigger my code when the Send button is pressed by the user not when the Application_ItemSend function is sent please?
I am a beginner to VBA so if answers could be in full that would be most helpful.
Thank you in advance, here's the code I have done so far:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If MsgBox("Make sure you are sending using Newforma - Are you sure you want to send this message?", vbYesNo + vbQuestion + vbMsgBoxSetForeground, "WARNING - NEWFORMA BYPASS ?") = vbNo Then
Cancel = True
End If
End Sub
I have a Add-in in Outlook (Newforma) that uses the Application_ItemSend function. You can send an email by clicking on Outlooks Send button or on this Addins button.
I wanted to write a small msgbox to remind people to use the Addin when they click on Outlook's Send button.
However because both these buttons trigger the Application_ItemSend my macro runs regardless which button I click.
I need a way to only trigger my code when the Send button is pressed by the user not when the Application_ItemSend function is sent please?
I am a beginner to VBA so if answers could be in full that would be most helpful.
Thank you in advance, here's the code I have done so far:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
If MsgBox("Make sure you are sending using Newforma - Are you sure you want to send this message?", vbYesNo + vbQuestion + vbMsgBoxSetForeground, "WARNING - NEWFORMA BYPASS ?") = vbNo Then
Cancel = True
End If
End Sub