Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / March 2008

Tip: Looking for answers? Try searching our database.

print word document

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JIM - 13 Mar 2008 18:07 GMT
Hi, using code found on-line I'm trying to print a word document in a report.
I get a run time error #424 saying "object required".  My document prints
well though. What I would like to do is instead of hard coding the location
as in C:\Wordtest.doc, can the file location be taken from a field from the
query the report is based on?  I've tried using the field name but don't know
the syntax.
Appreciate any help,
JIM

Private Sub Report_Open(Cancel As Integer)
   PrintDoc() = True
End Sub
Function PrintDoc()
  Dim WordObj As Object
  Set WordObj = CreateObject("Word.Application")
  WordObj.Documents.Open "C:Wordtest.doc"
  WordObj.PrintOut Background:=False
  WordObj.Quit
  Set WordObj = Nothing
End Function
JIM - 20 Mar 2008 18:04 GMT
I'll repost and try another route.
JIM

> Hi, using code found on-line I'm trying to print a word document in a report.
>  I get a run time error #424 saying "object required".  My document prints
[quoted text clipped - 16 lines]
>    Set WordObj = Nothing
> End Function
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.