View Single Post
 
Old 07-26-2021, 08:15 AM
JamesWood JamesWood is offline Windows 10 Office 2019
Advanced Beginner
 
Join Date: Nov 2020
Posts: 37
JamesWood is on a distinguished road
Question

Thanks Graham! I feel like I could be onto something here, but have no idea what to use for my 'For i =' ?


Sub CountRecipients2() 'Accurate count of recipients even if some records are unticked
Dim i As Long 'For the loop
Dim oCount As Integer 'Counts the records
Dim oResult As String 'String to display in final count
ActiveDocument.MailMerge.DataSource.ActiveRecord = wdFirstRecord 'Default start to first record
oCount = 1 'Count starts at 1
For i = ??? 'Loop begins
ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord 'Move to next record
oCount = oCount + 1 'Add 1 to the total count
Next i
oResult = oCount
MsgBox (oResult)
End Sub
Reply With Quote