473,715 Members | 6,082 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 7734

"Jeff Harbin" <Pr******@minds pring.com> wrote in message
news:%O******** *******@newsrea d2.news.atl.ear thlink.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***@earthlin k.net> wrote in message
news:0d******** *******@newsrea d1.news.atl.ear thlink.net...

"Jeff Harbin" <Pr******@minds pring.com> wrote in message
news:%O******** *******@newsrea d2.news.atl.ear thlink.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******@minds pring.com> wrote in message news:<%O******* ********@newsre ad2.news.atl.ea rthlink.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.applicatio n
else
appWord.Open strFile
End if

appWord.ActiveD ocument.Print
appWord.ActiveD ocument.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********@hot mail.com> wrote in message
news:bf******** *************** ***@posting.goo gle.com...
"Jeff Harbin" <Pr******@minds pring.com> wrote in message

news:<%O******* ********@newsre ad2.news.atl.ea rthlink.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.applicatio n
else
appWord.Open strFile
End if

appWord.ActiveD ocument.Print
appWord.ActiveD ocument.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
2327
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 relevant. The code I use is Private Sub Cmdstart_Click() On Error GoTo Err_Handler Dim strPath As String If IsNull(DocURLtxt.Value) Then strmsg = "You must enter the Document URL to use this function
5
3342
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 = "P:\2004worksheets\IIS_WS.doc" Set oWord = New Word.Application oWord.Documents.Add (strObjectPath) oWord.PrintOut
4
5872
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 of the document to Word for duplexing there. I was looking for a VBA method for doing this, so the KB article is right out and when you export to Word, some of the report's text boxes wind up truncated because of some sort of sizing difficulty...
3
2395
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 record, but do not know how to write the code to open the word doc and print it. I assume this code should be put in the list box print button. As you can see, I have two different reports that go out; one (or more) to Surgery, and one (or more) to...
0
1650
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 (I can't kill the winword procees: access denied). her is the code i use: oWordApp = New Word.ApplicationClass oWordDoc = oWordApp.Documents.Add("d:\\coucou2.doc") oWordDoc.Activate() oWordDoc.PrintOut() oWordDoc.Close()
4
2074
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 fine. If htey choose to "just print it" it seems ot ignore this command:
1
5712
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 of a Microsoft book, "Visual Basic,Net Step by Step" in Chapter 18. All but the bottom two subroutines will open a text file, and then allow me to use the above controls, example 1. The bottom two subroutines will print a graphic file, example...
1
7546
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. Each printing order takes about 2 or 3 seconds to complete which can be long when you have 200 different documents to print. I'm using Word because I want the users to be able to easily create some templates containing specials fields that the...
2
4839
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 yet. What confuses me is 1. All the documents to be printed are in the same directory - The application directory - so the authorities to the objects
0
8823
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9198
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9104
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9047
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6646
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4477
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4738
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3175
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2119
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.