help a gal out! how can i print an access report to office document image writer with code?

  • Thread starter Thread starter emebohw2
  • Start date Start date
E

emebohw2

I really need to output a report to office document image writer and I
need to do so with code. Can someone post an example of how to do this?
Please, please, please!
-thanks
 
Open the report in design view.
Choose Page Setup from the File menu.
On the middle tab, choose Specific Printer.

If you want to do this programmatically, and you are using Access 2002 or
2003, you can set the printer before you OpenReport like this:
Application.Printer = Application.Printers("Microsoft Office Document Image
Writer")

Other alternatives:
http://allenbrowne.com/AppPrintMgt.html
 
Hi Allen, I actually have been to your website a couple of times!
Thanks for the suggestion, but would you happen to know how I can do
that and specify 'print to file' and of course a file name in code?

I had orginally tried using code that exported to access snapshot, and
I could specify file name and the folks who use the database didnt have
to do so. Unfortunately hyperlinks dont function in the snapshots, so I
thought I would switch to the MS image because they do work there.

Thanks!
 
OutputTo (in a macro or code) lets you kick a report out to a file. I doubt
you will get operational hyperlinks though. Guess you could try HTML format.
 
Also, if you or anyone happens to visit this again, how do I force
everything to one page? I have a report that always goes two pages long
and when exported to HTML it creates two web pages, which is not
desirable.
 
Yes, I find that really annoying also. What I have done in the past is to
acually write the HTML file in VBA code, i.e.:


1. Open a file for output

2. OpenRecordset()

3. Loop through the recordset, using Print #

4. Close the recordset and Close the file.

It's messy, but you get a single page, and you can build the hyperlinks
(anchor tag) so they work.
 
Back
Top