Stamp custom field values in email body

Joined
Jan 13, 2009
Messages
2
Reaction score
0
i added two custom text fields to my email. I want on Application_ItemSend to stamp the values of these fields (also with the subject) in the body of my email.

I have it working for the subject field (see code below) but i cant get it working for the two custom fields! I have tested with Mileage field and that works as well but how do i get the values of the two custom fields in there?

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strStamp As String

On Error Resume Next
Set objOL = Application
Set objItem = objOL.ActiveInspector.CurrentItem

If Not objItem Is Nothing Then
Set objNS = objOL.Session
strStamp = " [SUBJECT] " & objItem.Subject & " [KLANT] " & objItem.Mileage
objItem.Body = objItem.Body & vbCrLf & strStamp
End If

Set objOL = Nothing
Set objItem = Nothing
Set objMileage = Nothing
End Sub

Thanks for all the help in advance
Marchel
 
Solved it myself.......

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strStamp As String
Dim objMe As Recipient

On Error Resume Next
Set objOL = Application
Set objItem = objOL.ActiveInspector.CurrentItem

If Item.UserProperties("ToKB").Value = True Then
Set objMe = Item.Recipients.Add("(e-mail address removed)")
Set objNS = objOL.Session
strStamp = "[KLANT]=[" & Item.UserProperties("Customer") & "]" & " [FOLDER]=[" & Item.UserProperties("Folder") & "]"

objMe.Type = olBCC
objMe.Resolve
objItem.Body = objItem.Body & vbCrLf & strStamp
End If

Set objOL = Nothing
Set objItem = Nothing
Set objMe = Nothing
End Sub
 
Back
Top