I have a form and am using the below code to try to send the text of a combo box using SMTP. The email works, but it comes out like so:
\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\EMAIL\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\
Maintenance Request
Submitted By: 3783
Time Requested: 3/17/2007 5:12:35 PM
Work Type: 3
Priority: 1
Location: Bay-A
Asset: BP-002
Problem Description: vvvvv
\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\\
\\
Now, this is basically what I want, but if you can tell, for example on the "Requestor" it shows a number. In my combo, this is actually text, but the combo is bound to a number so I can understand why it does this. Below is the code I have been trying to just use the actual TEXT of the combo versus its value with no success. I have tried "me.reqid.text" and "reqid.text" amoung other things with no success.
\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\
\\\VBA CODE\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\
\\\\\\\\\
Dim objCDOMail As Object
Set objCDOMail = CreateObject("CDO.Message"
)
objCDOMail.To = "--SOME EMAIL--"
objCDOMail.FROM = "--SOME EMAIL--"
objCDOMail.Subject = "MAINTENANCE REQUEST"
objCDOMail.TextBody = "Maintenance Request" & vbCrLf & vbCrLf & "Submitted By: " & Me.reqid & vbCrLf & "Time Requested: " & Me.DateRec & vbCrLf & "Work Type: " & Me.WorkType & vbCrLf & "Priority: " & Me.WorkPriority & vbCrLf & "Location: " & Me.LocationNo & vbCrLf & "Asset: " & Me.AssetNo & vbCrLf & vbCrLf & "Problem Description: " & Me.ProbDesc
objCDOMail.configuration.F
ields.Item
("
http://schemas.microsoft.com/cdo/configuration/sendusing")
= 2
objCDOMail.configuration.F
ields.Item
("
http://schemas.microsoft.com/cdo/configuration/smtpserver"
) = ""
objCDOMail.configuration.F
ields.Upda
te
objCDOMail.Send
Set objCDOMail = Nothing
Start Free Trial