0

In a new email message OR a reply message, I want to change the delivery date and time to the next day at a certain time, say 8AM.

I want to be able to click one button in my toolbar and the date and time to be set automatically.

Delayed Delivery
enter image description here

Macro Needed
enter image description here

Community
  • 1
  • 1
Tony R
  • 1
  • I am using this macro, but it creates a new email, I need to be able to append to an existing email thread or reply. Public Sub SendDeferredMessage() Dim objMsg As MailItem Dim SendAt Set objMsg = Application.CreateItem(olMailItem) 'send at 8:24 AM. .25 = 6 AM, .50 = noon SendAt = DateSerial(Year(Now), Month(Now), Day(Now)) + 0.35 objMsg.DeferredDeliveryTime = SendAt 'displays the message form objMsg.Display Set objMsg = Nothing End Sub – Tony R Jun 10 '21 at 04:06
  • Please include it in your question, not in a comment. – braX Jun 10 '21 at 04:13
  • https://stackoverflow.com/a/41318693/4539709 – 0m3r Jun 11 '21 at 05:18

1 Answers1

0

In your code you are creating a new MailItem instance where the MailItem.DeferredDeliveryTime property is set which stands for a date indicating the date and time the mail message is to be delivered.

Instead, you need to get the current item displayed in the inspector window in Outlook. To get this done, you need to use the ActiveInspector property which returns the topmost Inspector object on the desktop.

Sub GetCurrentItem()
 Dim myinspector As Outlook.Inspector 
 Dim myItem As Outlook.MailItem 
 
 Set myinspector = Application.ActiveInspector 
 Set myItem = myinspector.CurrentItem 
End Sub
Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45