vba - prepending data to replies

C

colinbashbash

Hey. I wanted to prepend different signatures to replies based on
whether the recipients were internal or external.

Currently, it's prepending it to the message before it prepends the
normal reply stuff. I'm not sure how to wait until after it does it's
formatting... thoughts?

Here's what i have now:
---------------------------------

Private WithEvents insp As Inspectors
Private Sub Application_Startup()
Set insp = Application.Inspectors
End Sub

Private Sub insp_NewInspector(ByVal Inspector As Inspector)
If (Inspector.EditorType = olEditorWord) Then
If TypeName(Inspector.CurrentItem) = "MailItem" Then
Dim m As MailItem
Set m = Inspector.CurrentItem
If m.Subject <> "" Then
Dim r As Recipient
Dim isOutside As Boolean
isOutside = False
For Each r In m.Recipients
If InStr(1, r.Address, "@CURRENTDOMAIN.com") = 0
And r.AddressEntry.Type <> "EX" Then
isOutside = True
End If
Next
If isOutside Then
m.Body = vbCrLf & "Thanks," & vbCrLf & "John Doe"
& vbCrLf & "(555).867.5309" & vbCrLf & m.Body
Else
m.Body = vbCrLf & "Thanks," & vbCrLf & "JD" &
vbCrLf & "x5309" & vbCrLf & m.Body
End If
End If
End If
End If
End Sub
 
M

Michael Bauer [MVP - Outlook]

Use the Activate event of the inspector object. For more VBA related
questions, please use the microsoft.public.outlook.program_vba group.

--
Best regards
Michael Bauer - MVP Outlook
Manage and share your categories:
<http://www.vboffice.net/product.html?pub=6&lang=en>


Am Thu, 7 Jan 2010 12:08:45 -0800 (PST) schrieb colinbashbash:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top