Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Opening a Document from MS Access

Status
Not open for further replies.

fearlessfreap24

Technical User
Jul 30, 2002
16
0
0
US
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?
 
Use your command button wizard and it will take you the process and write the code for you.

rollie@bwsys.net
 
i have tried that, instead of opening an aplication, i selected the document. when the button is clicked i get an error message.
 
Try the following

'****** 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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top