I have a database that is mail merged with a MS Word document. I have figured out how to create a button on the form to open Word. How do I create a button that will open the mail merged document?
'****** Code Start ********
Private mobjWordApp As Word.Application
Private Sub Command1_Click()
Const conTEMPLATE_NAME = "\Templates\merge.dot"
Set mobjWordApp = New Word.Application
With mobjWordApp
.Visible = True
.WindowState = wdWindowStateMaximize
.Documents.Add Template:=(.Options.DefaultFilePath( _
wdUserTemplatesPath) _
& conTEMPLATE_NAME)
End With
End Sub
'****** Code End ********
Neil Berryman
IT Trainer
neil_berryman@btopenworld.com
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.