The code below correctly saves and renames some of my documents in a mail merge. The problem i am having is with the if and next part of the code. This code should loop through all of my mail merge documents but it will only loop through three of four and the macro will stop. Any suggestions on how to fix this so it will loop through all the documents in my mail merge.
Thanks, Brian

Sub PrintSave()
Dim DokName As String
Dim i As Integer

For i = 1 To ActiveDocument.MailMerge.DataSource.ActiveRecord
ActiveDocument.MailMerge.DataSource.ActiveRecord = i
With ActiveDocument.MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
.LastRecord = ActiveDocument.MailMerge.DataSource.ActiveRecord
' Remember the wanted documentname
DokName = .DataFields("NAME").Value ' ADDED CODE
End With

' Merge the active record
.Execute Pause:=False
End With

' Save then resulting document. NOTICE MODIFIED filename
ActiveDocument.SaveAs2 Filename:="C:\Users\Brian_Donovan\Documents\test\" + DokName + ".docx", FileFormat:= _
wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles _
:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False, CompatibilityMode:=14

' Close the resulting document
ActiveWindow.Close

' Now, back in the template document, advance to next record
ActiveDocument.MailMerge.DataSource.ActiveRecord = wdNextRecord
Next i
End Sub