Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

emailing in vba with outlook wont always send

Status
Not open for further replies.

newnoviceuser

Programmer
Jan 4, 2003
63
US
this is the code
Sub email()
Dim TextLine
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem

Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.To = "tome@colla.com"
.Subject = "report for " & gtdate()
.Attachments.Add "C:\report.rtf"
.Send
End With
very simple code and will send sometimes immediately and sometimes just goes in the outbox and waits. how can i make sure it sends it out? these reports are needed daily by several people. thanks in advance
 
Hi,

How long does it sit in your Outbox?

I had a similar issue using Outlook Redemption and found that when one of my scheduled Send/Receive happened (or I did a manual one or maybe two) the e-mail sent fine.

Hope this helps

HarleyQuinn
---------------------------------
Get the most out of Tek-Tips, read FAQ222-2244 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top