Could someone please help me with the following error...
I am trying to send a text file and the 1st text message goes without any problems...
When it tries to send the 2nd message I get a debug that stops on the
.To
the error states that the address can not be found....I am using the same email address on both of these, if that is what is triggering the error.
Dim OutApp As Outlook.Application
Dim OutMail As Outlook.MailItem
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(olMailItem)
If Range("F5").Value = "Yes" Then
With OutMail
.To = "myemail@mydomain.com"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = GetBoiler("locationoffile\borrow.txt")
.Send 'or use .Display
End With
End If
If Range("G5").Value = "Yes" Then
With OutMail
.To = "myemail@mydomain.com"
.CC = ""
.BCC = ""
.Subject = "This is the Subject line"
.Body = GetBoiler("locationoffile\cob.txt")
.Send 'or use .Display
End With
End If
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
thanks for any help
Bookmarks