| re: Printing a Word Document from ACCESS
"Jeff Harbin" <Prez1210@mindspring.com> wrote in message news:<%OrCb.947$X97.681@newsread2.news.atl.earthli nk.net>...[color=blue]
> I've got an ACCESS 2000 application that I'm developing. One of the outputs
> of this app will be to generate a series of 'jobs' which corresponds to a
> record in the database. Each record will be printed on its own page which
> I've set up as a report and that's working fine.
>
> Accompanying each job is a Word (or Excel) document. Most jobs will have
> Word (or Excel) documents unique to the record. I know how to establish a
> hyperlink field in the record but how do I get it to open the document,
> print the document, and then close Word (or Excel) when the document is
> printed.
>
> Thanks,
>
> Jeff[/color]
You could create a sub or function inside Access that opened the
file(s) in question, printed them, and then closed the automated
application. I would probably do it something like this...
'---this is aircode, so check your syntax
if not fIsAppRunning("Word") Then
set appWord = new word.application
else
appWord.Open strFile
End if
appWord.ActiveDocument.Print
appWord.ActiveDocument.Close acSaveNo
'---end bad air code...
Then you would loop through the list of files in your subform and open
each, printing them out...
appWord.Print |