B
Bob Allen-Turl
Apologies if this has been "done to death" numerous times but neve
having used Outlook I need all the help I can get.
The following programme was SUPPOSED to send e-mails and cc: mail
through Outlook automatically. As shown on the worksheet I set it t
mail two of my own addresses, one on Hotmail and one on my website.
Code
-------------------
Sub SendWithAtt()
Dim c As Range
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurrFile As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
Sheet1.Select
With olMail
For Each c In Range("STATUS")
If c = "NO" Then
.To = c.Offset(0, 4).Value
.CC = c.Offset(0, 5).Value
.Subject = c.Offset(0, 2).Value
.Body = c.Offset(0, 3).Value
.Send
End If
Next
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
-------------------
But running the routine a msgbox appears telling me “The networ
connection is temporarily unavailable and the message will be kept i
the Outbox until the connection is restored”.
When I opened Outlook a msgbox said “We were unable to sign in to you
account. Please try again, We currently cannot access your account
Please try again.”
So I opened up the Outbox, opened the first mail in the folder. , trie
pressing “Send” and got the original Messagebox appearing.
Returned to Excel VBA code. Found programme highlighting the “To” fiel
with a msgbox saying “RunTime Error 462. The remote server machine doe
not exist or is unavailable”.
So not only does my code not work, I seem to have "done something" to m
Outlook!
Excel sheet is attached as a "screenprint" as I could not upload th
Macro-enabled file.
Any guidance accepted gratefully
Bob Allen-Tur
+-------------------------------------------------------------------
|Filename: outlook_link.jpg
|Download: http://www.outlookbanter.com/attachment.php?attachmentid=26
+-------------------------------------------------------------------
having used Outlook I need all the help I can get.
The following programme was SUPPOSED to send e-mails and cc: mail
through Outlook automatically. As shown on the worksheet I set it t
mail two of my own addresses, one on Hotmail and one on my website.
Code
-------------------
Sub SendWithAtt()
Dim c As Range
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurrFile As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
Sheet1.Select
With olMail
For Each c In Range("STATUS")
If c = "NO" Then
.To = c.Offset(0, 4).Value
.CC = c.Offset(0, 5).Value
.Subject = c.Offset(0, 2).Value
.Body = c.Offset(0, 3).Value
.Send
End If
Next
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
-------------------
But running the routine a msgbox appears telling me “The networ
connection is temporarily unavailable and the message will be kept i
the Outbox until the connection is restored”.
When I opened Outlook a msgbox said “We were unable to sign in to you
account. Please try again, We currently cannot access your account
Please try again.”
So I opened up the Outbox, opened the first mail in the folder. , trie
pressing “Send” and got the original Messagebox appearing.
Returned to Excel VBA code. Found programme highlighting the “To” fiel
with a msgbox saying “RunTime Error 462. The remote server machine doe
not exist or is unavailable”.
So not only does my code not work, I seem to have "done something" to m
Outlook!
Excel sheet is attached as a "screenprint" as I could not upload th
Macro-enabled file.
Any guidance accepted gratefully
Bob Allen-Tur
+-------------------------------------------------------------------
|Filename: outlook_link.jpg
|Download: http://www.outlookbanter.com/attachment.php?attachmentid=26
+-------------------------------------------------------------------