You didn't really expect to find a macro pre-coded to look for 'W' remark in column 'J' did you? As I said, the code would need to be adapted, which is a trivial undertaking:
Sub Merge_To_Individual_Files()
Application.ScreenUpdating = False
Dim StrFolder As String, StrName As String, MainDoc As Document, i As Long, j As Long, BlnEx As Boolean
Const StrNoChr As String = """*./\:?|"
Set MainDoc = ActiveDocument
With MainDoc
StrFolder = Replace(.Path, "\INPUT", "\OUTPUT E\")
For i = 1 To .MailMerge.DataSource.RecordCount
BlnEx = True
With .MailMerge
.Destination = wdSendToNewDocument
.SuppressBlankLines = True
With .DataSource
.FirstRecord = i
.LastRecord = i
.ActiveRecord = i
If Trim(.DataFields("NAME_E")) = "" Then Exit For
StrName = .DataFields("NAME_E")
End With
If Trim(.DataFields("REMARK")) = "-" Then BlnEx = False
If BlnEx = True Then .Execute Pause:=False
End With
If BlnEx = True Then
For j = 1 To Len(StrNoChr)
StrTxt = Replace(StrName, Mid(StrNoChr, j, 1), "_")
Next
StrName = Trim(StrName)
With ActiveDocument
.SaveAs FileName:=StrFolder & StrName & ".docx", FileFormat:=wdFormatXMLDocument, AddToRecentFiles:=False
' and/or:
.SaveAs FileName:=StrFolder & StrName & ".pdf", FileFormat:=wdFormatPDF, AddToRecentFiles:=False
.Close SaveChanges:=False
End With
End If
Next i
End With
Application.ScreenUpdating = True
End Sub
Bookmarks