473,320 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Printing a Word Document from ACCESS

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
4 7571

"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
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
"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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Tony Williams | last post by:
I have an Access database that we use as a document index system. The documents can be Word, Excel, pdf's etc I have a command button on a form that opens the document in whatever program is...
5
by: Stefania Scott | last post by:
I am trying to print a word document from Access. The code I've written works well in my computer but does not in the one were it is needed. Here the piece of code: 'doc path strObjectPath =...
4
by: Jamey Shuemaker | last post by:
I've been looking for a way to do a duplex print job without a duplex printer. I reviewed some old posts about printing odd pages and found that most of them led to KB article 101075 or an export...
3
by: David | last post by:
Hello, hope someone can help. I have a request to print word .doc check lists with selected records in Access for surgery procedure cards. I have hyperlinked the word doc's to a field in each...
0
by: Youss33 | last post by:
I have a problem printing a word document from an ASP.NET application. the Application doesn't send an error back but the document is not printed and the document is kept open by the application...
4
by: scorpion53061 | last post by:
I have my Word document being created in a seperate thread. THe applicaiton is not visible. The end user can choose to view the document upon completion or just have it print. Viewing is...
1
by: hamil | last post by:
I am trying to print a graphic file (tif) and also use the PrintPreview control, the PageSetup control, and the Print dialog control. The code attached is a concatination of two examples taken out...
1
by: Laurent Navarro | last post by:
Hi, I created a C# application which opens a Word document, fills some fields and sends the whole document to the printer. Everything is working great but I find the printing step very slow....
2
by: Iain Wilson | last post by:
Hi Mike I have changed the code using Server.MapPath but to no avail. Prints the Adobe PDF document to the default local printer (I am running this localhost). I Have not run it on the server...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.