Hello again,
I am now trying to use Outlook to send mail. I am using the following code:
'******begin code*****
Dim strEmail, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
'**creates an instance of Outlook
Set objOutlook = CreateObject("Outlook.application"

Set objEmail = objOutlook.CreateItem(olMailItem)
'**************************************************************
'*create string with email address
strEmail = [EMAIL ADDRESS]
strBody = txtTDate & Chr(13) & Chr(13)
strBody = strBody & "Dear " & [FIRST NAME] & " " & [LAST NAME] & "," & Chr(13) & Chr(13)
strBody = strBody & "Your item was shipped today." & _
" Please let us know when you receive it." & Chr(13) & Chr(13) & Chr(13)
strBody = strBody & "Shipping method: " & [SHIPPING METHOD] & Chr(13)
strBody = strBody & "Date shipped: " & [DATE SHIPPED] & Chr(13)
strBody = strBody & "Tracking / Confirmation number: " & [TRACKING NUMBER] & Chr(13)
strBody = strBody & "Sincerely," & Chr(13) & Chr(13)
strBody = strBody & "Acme Corporation"
'***creates and sends email
With objEmail
.To = strEmail
.SUBJECT = "Your item has been shipped"
.body = strBody
.Send
End With
Set objEmail = Nothing
objOutlook.Quit
Exit Sub
End Sub
'****end code*****
When I try to send mail, I get the following error:
"Run-time error '-1975500795 (8a404005)':
Outlook does not recognize one or more names"
In the debug screen, the .Send is highlighted in yellow. What am I doing wrong?