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
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