Thread: [Solved] Email Merge With Delay
View Single Post
 
Old 02-21-2018, 04:41 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

I believe the following should meet your needs:
Code:
Sub Timed_Email_Merge()
' Merges one record at a time to email with a pre-defined delay between messages.
' Sourced from: https://www.msofficeforums.com/mail-merge/38282-email-merge-delay.html
Application.ScreenUpdating = False
Dim i As Long
With ActiveDocument.MailMerge
  .Destination = wdSendToEmail
  .MailAddressFieldName = "Email"
  .MailSubject = "Subject"
  .SuppressBlankLines = True
  For i = 1 To .DataSource.RecordCount
    With .DataSource
      .FirstRecord = i
      .LastRecord = i
      .ActiveRecord = i
    End With
  .Execute Pause:=False
  Call Pause(10)
  Next i
End With
Application.ScreenUpdating = True
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
Note that you need to edit the lines:
.MailAddressFieldName = "Email"
and:
.MailSubject = "Subject"
to ensure the correct field for the email addresses and the desired email subject line, respectively, are employed.

You can vary the delay by changing the value in:
Call Pause(10)
Presently, it's set for 10 seconds. At that rate, your 300 emails would take 50 minutes to send. With your suggested 90-second intervals, it would take 7.5 hours...

For PC macro installation & usage instructions, see: Installing Macros
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote