Here is the onclick command of Alberts code:
Code:
Private Sub cmdMerge_Click()
Dim strExt As String
strExt = IIf(Application.Version <= 11, ".doc", ".docx")
' merge the doc
If IsNull(Me.lstFiles) = False Then
' for compat
If Dir(strDirPath & Me.lstFiles & strExt) = "" Then
If strExt = ".docx" Then
strExt = ".doc"
End If
End If
Call RidesMergeWord(strDirPath & Me.lstFiles & strExt, strDirPath, strOutDocName)
strTemplate = Me.lstFiles
DoCmd.Close acForm, Me.Name
Else
MsgBox "You need to select a Word document", vbExclamation, "Word Merge"
strTemplate = ""
End If
End Sub
Would I be inserting your code before " Call RidesMergeWord(strDirPath & Me.lstFiles & strExt, strDirPath, strOutDocName)" or set it = to "strTemplate" (in the line below)?
...or am I completely wrong...
Thank you!
David92595