Thread: [Solved] Email Merge With Delay
View Single Post
 
Old 04-20-2020, 02:46 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

What you're asking is to effectively delay the mailmerge's execution, not to space out the sending of those emails. That is quite a different proposition, for which you might use something like:
Code:
Sub Delayed_Email_Merge()
' Delays a merge to email by a pre-defined period.
' Sourced from: https://www.msofficeforums.com/mail-merge/38282-email-merge-delay.html
Call Pause(3600 * 1)
With ActiveDocument.MailMerge
  .Destination = wdSendToEmail
  .MailAddressFieldName = "Email"
  .MailSubject = "Subject"
  .SuppressBlankLines = True
  .Execute Pause:=False
End With
End Sub

Public Function Pause(Delay As Long)
Dim Start As Long
Start = Timer
If Start + Delay > 86399 Then
  Start = 0: Delay = (Start + Delay) Mod 86400
  Do While Timer > 1
    DoEvents ' Yield to other processes.
  Loop
End If
Do While Timer < Start + Delay
  DoEvents ' Yield to other processes.
Loop
End Function
In the above code, '3600 * 1' represents 1 hour (i.e. 3600 seconds). Change the '1' to whatever number of hours you require.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote