When more than "ItemSend" is needed

Status
Not open for further replies.

ENLLP

New Member
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
 
Looking for what? If you only need to support Outlook 2010 and older, that would be easier. If 2013 and up, what language would you be using, do you have Visual Studio for creating an Addin? If you don´t have any experience in creating and deploying Addins, I´d first ask the vendor of NewForma to customize their Addin for you. That could be cheaper.
 
I can see I'm getting a flat "No it cant be done" in this forum ;-) but in some others their exploring the idea of using the Cancel button as a trigger. this still hasn't work but its made me think that clicking on the cancel might cause an event that can be used to differentiate between the 2?

Private Sub Newforma()
' Cancel = True is a flag indicating Newforma invoked Application_ItemSend
Application_ItemSend CreateItem(0), True
End Sub

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

If Cancel = False Then ' User clicked the Send button
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

Else
' Cancel starts as True when Application_ItemSend was invoked by Newforma
' Reverse the Cancel
Cancel = False

End If

End Sub
 
Maybe you´d get better answers if you´d share details. We still don´t know which versions of outlook you want to support. If using NewForma´s Send button instead of Outlook´s button is important, NewForma really could be interested in overwriting Outlook´s button as mentioned. Did you ask them?

Since the NewForma Addin for sure doesn´t call your NewForma procedure when you click its Send button, that approach cannot work.
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M How create a Rule to filter sender's email with more that one @ sign Using Outlook 1
P Outlook pst file is too huge with POP3. How to save more space? Using Outlook 4
C blocking two or more word domains separated by period/dot Using Outlook 3
C How to use VBA to show only items x days old or more Outlook VBA and Custom Forms 1
N VBA to delete duplicates by message-id on common pst for 2 or more emails Outlook VBA and Custom Forms 0
geofferyh Cannot get Macro to SAVE more than one message attachment??? Outlook VBA and Custom Forms 5
B Looking to filter (or just find/search) for only messages that the sender has sent more than 1 messa Using Outlook 2
B When I add more search strings to RULES, it is not processing them Using Outlook 3
O Display more months in 'Tasks' Using Outlook 3
A BCM does not work with Windows 10 1703 any more BCM (Business Contact Manager) 3
K adding more rules to 'different domains check' macro Outlook VBA and Custom Forms 2
Diane Poremsky Booking meetings more than 180 days out Using Outlook 1
Diane Poremsky Could not complete the operation. One or more parameter values are not valid. Using Outlook 0
W Showing more months in the Calendar nav pane Using Outlook 10
B Search Folder for search messages in more than one account and / or multiple PST folders Using Outlook 3
C Quick Parts signatures suddenly require more letters Using Outlook 2
Diane Poremsky Make 'today' stand out more in the calendar Using Outlook 0
Diane Poremsky More Tools and Utilities for Sharing Outlook Data Using Outlook 0
N To do bar - show more than 30 days of appointments Using Outlook 0
Q shortcut to more stationery Using Outlook 4
F Missing "More Settings" in Outlook 2007 Professional Using Outlook 8
O Stop more than one person responding to an email? Using Outlook 1
J Show three or more months in Calendar Using Outlook 1
M Can't open same msg file more than once at the same time in Outlook 2010 Using Outlook 7
A Setting RULES with more than one condition in MS OUTLOOK Using Outlook 6
T using IMAP with a single email account on two or more computers Using Outlook 3
C Whose brilliant idea was to make it more difficult to scroll in Outlook? Using Outlook 0
G "database is not compatible with BCM for Outlook 2013" & more BCM (Business Contact Manager) 0
C Using iCloud in more than one Outlook profile Using Outlook 0
B Consolidating more than one Outlook profiles Using Outlook 1
dolke Strange Outlook behavior when receiving emails. More info in the content... Using Outlook 7
M No More Spam Mail Using Outlook 1
K Need to get OOO messages more than once for the same email box Using Outlook 2
Y BCM Contacting 2 or more contacts under one account BCM (Business Contact Manager) 2
S Help with optimizing Outlook (With BCM and more) Using Outlook 3
B Would like to add more fields in the Genral contacts tab Using Outlook 1
C Looking for way to tie a Business Contact to more than one Account BCM (Business Contact Manager) 5
T More than one outlook account to setup & move Using Outlook 1
D Add-In or Other to Make Outlook More "OneNote Like"? Using Outlook 5
D RE: How to display more items per day in monthly calendar? Using Outlook 2
E Creating Form Regions with more than one page Outlook VBA and Custom Forms 13
E Creating Form Regions with more than one page Outlook VBA and Custom Forms 13
G To Prevent Malicious Code from running, one or more objects in thi BCM (Business Contact Manager) 2
E Display Outlook Data from more than one Folder like SQL JOIN Outlook VBA and Custom Forms 3
S Unable to enumerate Mailboxes in NON Cached Mode (if more than 2) Outlook VBA and Custom Forms 8
U Outlook does not recognize one or more names Outlook VBA and Custom Forms 1
Q More than one Notes section in custom contact forms Outlook VBA and Custom Forms 1
S To help prevent malicious code from running, one or more objects in this form were not loaded. For m Outlook VBA and Custom Forms 1
I one or more parameters not valid 2007 sending email BCM (Business Contact Manager) 2
B Looking for email address under ItemSend event Outlook VBA and Custom Forms 6

Similar threads

Back
Top