I have a script that works only if i manually run it from the macro tools option. How can i make it run automatically when outlook is started.
Public WithEvents myOlApp As Outlook.Application
Public Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.Application")
End Sub
Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim prompt As String
If InStr(1, Item.Subject, "For Official Use Only - Privacy Sensitive", vbTextCompare) = False Then
Item.Subject = Item.Subject & " For Official Use Only - Privacy Sensitive"
End If
End Sub
Public WithEvents myOlApp As Outlook.Application
Public Sub Initialize_handler()
Set myOlApp = CreateObject("Outlook.Application")
End Sub
Private Sub myOlApp_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim prompt As String
If InStr(1, Item.Subject, "For Official Use Only - Privacy Sensitive", vbTextCompare) = False Then
Item.Subject = Item.Subject & " For Official Use Only - Privacy Sensitive"
End If
End Sub