Getting Outlook to Send/Receive

J

Joey Lichtenstein

Greeetings!

I have some code to send mail using VBA that works great at my office, but
unfortunately at home, I need to do a manual "Send/Receive" to get it to
work.

Is there a way I can automatically get Outlook to Send/Receive every time
a new message is ready, or maybe modify this code so it forces a
Send/Receive?

Thanks in advance!

Joey

Sub MailDoc(SubjectLine, MessageBody, Email)

Set myRedMsg = CreateObject("Redemption.SafeMailItem")
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)

myItem.To = Email
myItem.Subject = SubjectLine
myItem.Body = MessageBody

myRedMsg.Item = myItem
myRedMsg.Send

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top