A programmer created a database for my company and I added a command button with the following code:
Dim WOrdApp As New Word.Application
Dim doc As Word.Document
WOrdApp.Documents.Open “C:My DocumentsNewClmtwithPCP.doc”
Set doc = WOrdApp.ActiveDocument
doc.MailMerge.Execute
doc.CLOSe SaveChanges:=wdDoNotSaveChanges
WOrdApp.Visible = True
WOrdApp.WindowState = wdWindowStateMaximize
This code worked great in his database but now I am making a database of my own and it won’t work. It won’t even recognize: Dim WordApp As New Word.Document
It’s like I don’t have the option of Word.Document.
Any suggestions?
I just want to open a merged word file from a command button.
Thanks.