Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Report as a postscript file

Status
Not open for further replies.

natatbh

Programmer
Dec 18, 2002
81
0
0
US
I want to Print Reports to a file using vba code. I'll explain exactly what I do without vba code and I whould like to know how to do it using vba code.
In a Mirosoft Access program I select a report. I then go to the menu and click 'print' which brings up a dialog box. In the dialog box I select the 'print to a file' checkbox.
This brings up another dialog box that prompts me for destination to print the file to. I enter a path and click OK. The report is then printed to that location as a postScript file. I want to accomplish all this using vba code and without any interaction from the user. Any Idea, Please help.

Thanks,
natatbh
 
Well, obviously you didn't like my previous answer
if you asked the same question in a new thread.
thread703-574992

I'm telling you though, using the ghostscript
facsimilie printer is how it'll work best for you.
I know it seems like you're just a step away and
all you have to do is find a way to programatically
check that printtofile checkbox, but it's not gonna
come any easier than my suggestion. >IF< you get it
to happen using that printtofile checkbox, it will
have to be using sendkeys because no access print
function has any kind of parameter for that.
and sendkeys is something you should try to avoid
if at all possible.

i'll admit, i'm no guru, and i'm not absolutely
100% positive you'll not get it to happen the
angle you want to take, but i know for sure that
the angle i reccommended, though it seems like
the harder way of the two to start, will probably
end up as less work.

-g
 
Thanks evilmousse

I actually have pdfwriter installed on my machine. I guess I'll try your idea.

Thanks
 
Well, pdfwriter probably isn't what you need,
you'll probably use the ghostscript writer.
The techniques for using both are very similar,
which is why I cited the pdfwriter example.

-g
 
Thanks evilmousse,

You ain't so evil after all, evilmoussse.

Anyway I want to try your solution. Can you please give me some help of how to set registry keys from access using vba. Also, I
am using access 97 and I can't get to the printer properties. For example if I type application.printers it doesn't recognize it. When I do it in access 2000 I have no problem. Is there any refrence or something else I have to set.

Thanks
natatbh
 
well, first off, ouch ouch ouch, access97 has a lot
of issues to it... I really reccommend using
a newer version. I don't know the intricacies
of the differences well enough to provide advice,
but I know the upgrade is well worth it.
However, there are people here and in the access
newsgroups who do know detailed differences if
you can ask a specific enough question.

As for setting the registry from vba, refer to
my answer in your original post, thread703-574992
I made a faq for you with a cut-n-paste regedit
module FAQ703-3719 that should be incredibly easy
to use.
..i've not tested the module in access97...

again, the steps to follow are:
1. get and install ghostscript
2. research how you would set the filename
to output (probably a registry key that
you'll have to identify, read the documentation
for ghostscript)
3. use the regedit module from my faq according
to the example i provide at the end.

-g

i aims ta please ^_^
 
Thanks evilmousse,

I guess I'll get to work.

Thanks
 
I tried out the FAQ703-3719. What a great piece of code. Works great and gives me great ideas.

Thanks,
natatbh
 
how goes the search for ghostscript writer's
filename output options? have you found
whether and what registry keys it uses?

i searched myself a little to no avail,
but i haven't searched what is probably the
best souce of info: the documetation that
should come with the program.

-g
 
I tried out the FAQ703-3719, it works fine but it did not take the file name I assigned to. I don't know what's going on.

Could someone help me? Thanks.

James
 
This post is for anyone who is searching since the date of the original post makes this a dead issue.

I'm doing the same thing, I need Access to dump a report in postscript format (so I can pass it a faxserver that will interperate the file).

In Windows XP I added a new printer in the Control Panel (Control Panel=>Printers and Faxes, Add Printer).
*Local Printer
*Create a new port=>Local Port
*Enter Port Name "FileOut"
*I then picked a driver, then..., ...
Now if I print a report and select this printer from the Dialog box (or the Specific Printer option on a report in Access) I now get a file named FileOut that is the *.ps file that represents the report.

The file works when passed to the fax server, and if I add the .ps file extension Adobe Distiller will process the file and create a *.pdf.

P.S. I don't know if it matters but when I picked the printer driver I picked one that was PS enabled (Canon PS-NX5000).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top