Share via

VB Code to send Delayed Outlook Message

Anonymous
2012-11-29T22:22:17+00:00

Hello,

I am looking for the vb code to send an outlook message on a certain date.  I have the code working properly to send the message but can’t figure out how to delay delivery.

Here is the code I am using to create the email (as I said, it is working)

With OLMail

.to = EmailAddrs

.cc = “David Cornett”

.Subject = “Breakfast Club Reminder”

.Body = MsgText

.Send

End With

Note: OLMail, EmailAddrs, & MsgText are dimmed and defined earlier in the code.

Note 2: I have discovered that there is a .Delay property but apparently that only brings the message to the user’s screen and allows the user to review the message before he/she clicks the send button.

Note 3: I have also found something called Mail.DeferredDeliveryTime  but don’t know how to use it

Any help you can give me is ALWAYS greatly appreciated.

Thanks

David

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2012-11-29T22:58:15+00:00

From Ron de Bruin's site:

DeferredDeliveryTime'Stay in the outbox untill this date and time

.DeferredDeliveryTime = "1/6/2007 10:40:00 AM"

'Wait four hours

.DeferredDeliveryTime = DateAdd("h", 4, Now)

Was this answer helpful?

5 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2012-12-04T22:49:38+00:00

    That appears to work. Sorry that it took so long to get back to this. Something more pressing came up.

    Thanks for your help.

    Was this answer helpful?

    0 comments No comments