PDA

View Full Version : Solved: How to add field in mail before sending !



separator
05-24-2005, 01:29 AM
Hello all! If anybodu know the way's to add field to letter before sending?
In another words - if it posible to add field like this:

myItem.UserProperties.Add("Number", olText).Value = "123"

to this mail, before send it:

Sub SendAttach(strAddress As String, strCCAddress As String, strSubject As String, strMsg As String)
Dim objOutlk 'Outlook
Dim objMail 'Email item
'Dim strMsg
Const olMailItem = 0
'Create a new message
Set objOutlk = CreateObject("Outlook.Application")
Set objMail = objOutlk.CreateItem(olMailItem)
objMail.To = strAddress
objMail.CC = strCCAddress
objMail.Subject = strSubject
'Add the body
objMail.Body = strMsg
objMail.Send
Set objMail = Nothing
Set objOutlk = Nothing
End Sub

Bob Phillips
05-24-2005, 03:12 AM
Hello all! If anybodu know the way's to add field to letter before sending?
In another words - if it posible to add field like this:

myItem.UserProperties.Add("Number", olText).Value = "123"

As simple as?

Sub SendAttach(strAddress As String, strCCAddress As String, strSubject As String, strMsg As String)
Dim objOutlk 'Outlook
Dim objMail 'Email item
'Dim strMsg
Const olMailItem = 0
Const olText = 1
'Create a new message
Set objOutlk = CreateObject("Outlook.Application")
Set objMail = objOutlk.CreateItem(olMailItem)
objMail.To = strAddress
objMail.UserProperties.Add("Number", olText).Value = "123"
objMail.CC = strCCAddress
objMail.Subject = strSubject
'Add the body
objMail.Body = strMsg
objMail.display
Set objMail = Nothing
Set objOutlk = Nothing
End Sub

separator
05-24-2005, 04:12 AM
Thanx xld! :friends: