473,394 Members | 1,124 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,394 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 7588

"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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.