M
mkboynton via OfficeKB.com
Is there anyway to make this run when the new mail message form loads?
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim myOlApp As New Outlook.Application
Dim myOLItem As Outlook.MailItem
Dim OrigBody
Set myOLItem = myOlApp.ActiveInspector.CurrentItem
If myOLItem.Subject = "FL DAILY INBOUND SHEET.xls" Then
OrigBody = myOLItem.HTMLBody
myOLItem.HTMLBody = "<HTML><H3>" & Format(Date, "MMM. DD, YYYY") &
"</H3></HTML>" & OrgBody
End If
If myOLItem.Subject = "Dropped Trailer Report Updates.xls" Then
OrigBody = myOLItem.HTMLBody
myOLItem.HTMLBody = "<HTML><H3>" & Format(Date, "MMM. DD, YYYY") &
"</H3></HTML>" & OrgBody
End If
End Sub
Like this, it only runs when the message is sent.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim myOlApp As New Outlook.Application
Dim myOLItem As Outlook.MailItem
Dim OrigBody
Set myOLItem = myOlApp.ActiveInspector.CurrentItem
If myOLItem.Subject = "FL DAILY INBOUND SHEET.xls" Then
OrigBody = myOLItem.HTMLBody
myOLItem.HTMLBody = "<HTML><H3>" & Format(Date, "MMM. DD, YYYY") &
"</H3></HTML>" & OrgBody
End If
If myOLItem.Subject = "Dropped Trailer Report Updates.xls" Then
OrigBody = myOLItem.HTMLBody
myOLItem.HTMLBody = "<HTML><H3>" & Format(Date, "MMM. DD, YYYY") &
"</H3></HTML>" & OrgBody
End If
End Sub
Like this, it only runs when the message is sent.