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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to print a word document from an Access Form

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
hi
I have a form with a print command button. I need this one page word document to print if someone hits the print button. I tried to add the word document to the form but there is a lot of text involved. I tried the shell command in VBA but it only opens up the word document in Word. I am running ACCESS 97, I dont know what command to use so if they hit the print button, the form plus the document would print. Please help.... Thanks... Munaf
 
Dim oApp As Word.Application
Dim oDoc As Word.Document
Set oApp = CreateObject("Word.Application")

oApp.Documents.Open ("mydoc.doc")
Set oDoc = oApp.ActiveDocument
oDoc.PrintPreview 'oDoc.Print
oDoc.Close
oApp.Quit
 
I tried running the code and I am getting this error message "User-defined type not defined". Any ideas!! Appreciate it...Munaf
 
Munaf Kas (Visitor) Aug 7, 2002
I tried running the code and I am getting this error message "User-defined type not defined". Any ideas!! Appreciate it...Munaf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top