By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,668 Members | 1,481 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,668 IT Pros & Developers. It's quick & easy.

Printing a Word Document from ACCESS

P: n/a
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
Nov 12 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

"Jeff Harbin" <Pr******@mindspring.com> wrote in message
news:%O***************@newsread2.news.atl.earthlin k.net...
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. ...

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.


In Access VBA create an instance of Word and open the job template. The
template should have bookmarks where you want to place the data from the
Access record. Once the document is open you can have Access go to the
bookmarks and insert the data. The have Access save the template to a new
name.

lemme know if you need more hints

Tim Mills-Groninger
Nov 12 '05 #2

P: n/a
Tim,

I'm not sure I follow you but let me explain my interpretation of your
message.

It sounds like you're suggesting something like a mail merge using ACCESS
records. If so, that isn't what I'm attempting to do. These Word documents
are job instructions. They can be 1 or 2 pages in length and they explain
the steps required to perform a specific job. Each specific job would have
it's own record in the ACCESS database.

Let me beat a dead horse, even more...

Some examples of ACCESS records would be
1) Calibrate pH meter in Tank #4201
2) Clean Mixer tank in Building #14
3) Change oil in air compressor

As you can see each of these ACCESS 'jobs' will have distinctly different
steps for completing them. I know that I could create a report for each
specific job and recreate the Word document in the report and I will if I
have to but the document already exists as a Word document and there are 87
specific jobs. That translates into a lot of RE-TYPING! If I could import
the Word documents as an ACCESS Report that'd make it easier but I don't
think I can.

Now that I've typed all that...will your method give me what I want. If so,
I will need some clarification.

Thanks

Jeff

"Tim Mills-Groninger" <ti***@earthlink.net> wrote in message
news:0d***************@newsread1.news.atl.earthlin k.net...

"Jeff Harbin" <Pr******@mindspring.com> wrote in message
news:%O***************@newsread2.news.atl.earthlin k.net...
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. ...

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.


In Access VBA create an instance of Word and open the job template. The
template should have bookmarks where you want to place the data from the
Access record. Once the document is open you can have Access go to the
bookmarks and insert the data. The have Access save the template to a new
name.

lemme know if you need more hints

Tim Mills-Groninger

Nov 12 '05 #3

P: n/a
"Jeff Harbin" <Pr******@mindspring.com> wrote in message news:<%O***************@newsread2.news.atl.earthli nk.net>...
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

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
Nov 12 '05 #4

P: n/a
I think I can handle that. I'll try it on Monday. Thanks so very much
"Pieter Linden" <pi********@hotmail.com> wrote in message
news:bf**************************@posting.google.c om...
"Jeff Harbin" <Pr******@mindspring.com> wrote in message

news:<%O***************@newsread2.news.atl.earthli nk.net>...
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

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

Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.