View Single Post
 
Old 04-12-2018, 05:27 AM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,144
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

If it works when you restart Outlook, it is almost certainly losing the startup event, which in any case shouldn't be necessary. Change the code to

Code:
Option Explicit
'Public WithEvents myOlApp As Outlook.Application
'Private Sub Application_Startup()
'    Initialize_handler
'End Sub
'Public Sub Initialize_handler()
'    Set myOlApp = Outlook.Application
'End Sub

'Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    Dim strGreeting As String
    'etc
and there is no event handler to lose.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote