' Make some variables for file name and path
myWord = "Form-Template.docx"
myPath = ActiveWorkbook.Path
' Create an instance of Word, Set the references to the specific files
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set docDest = objWord.Documents.Open(myPath & "\" & myWord)
' Use the report form to generate the report - added to worksheet with the name myWSName
' After I create the worksheet with the data I want, I find the last row and last column, and then copy
' everything. If you only want to start at A6, change ".Range(.Cells(1,1)," to ".Range(.Cells(6,1),"
With myWB.Sheets(myWSName)
tmpRows = .Cells(.Rows.Count, 1).End(xlUp).Row
tmpCols = .Cells(1, .Columns.Count).End(xlToLeft).Column
.Range(.Cells(1, 1), .Cells(tmpRows, tmpCols)).Copy
End With
' Paste the copied data into Word at the bookmark "empHistory"
docDest.bookmarks("empHistory").Range.PasteExcelTable _
LinkedToExcel:=False, _
WordFormatting:=False, _
RTF:=False
' The rest of this is creating a new name, saving the file, printing the Word file, Closing the file
' closing Word, and then clearing out "objWord" so I can do this again if needed
myNewName = myPath & "My File Name" & Format(txtDate.Value, "dd-mm-yy") & ".docx"
docDest.SaveAs (myNewName)
docDest.PrintOut
docDest.Close
objWord.Quit
Set objWord = Nothing