473,897 Members | 2,577 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 7794

"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
2334
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
3360
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
5877
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
2404
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
1656
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
2080
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
5729
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
7553
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
4842
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
9990
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
9837
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10849
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
10939
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,...
1
8031
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
7183
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5872
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...
2
4292
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3299
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.