Hello everyone,
I am desperately trying to run the code below.
When I want to run the macro I get an error code "5151" that tells me that the program cannot find the file.
My problem is the following, I would like to print the two word files in one program and indicating only the beginning of the file name (FMON027 and FMON036).
Thank you in advance for your help!!!
Sincerely
Benten667
Private Sub CommandButton1_Click()
Dim WD As Object
Set WD = CreateObject("Word.Application")
WD.Documents.Open ("T:\Technique\" & "FMON027 *.docx")
WD.ActiveDocument.PrintOut Background:=False
WD.ActiveDocument.Close
WD.Documents.Open ("T:\Technique\" & "FMON036 *.docx")
WD.ActiveDocument.PrintOut Background:=False
WD.ActiveDocument.Close
WD.Quit
Set WD = Nothing
Unload Me
End Sub
Bookmarks