ACROBAT SHORTCUT

S

Sammie

Is there a way to create a customized button on my toolbar to print my
report to Adobe Acrobat, and then automatically change the printer back
to my default printer? I am not very familiar with macros in Access,
but I use Visual Basic all the time. I have created a macro in Word to
do what I want, and assigned it to a button there. Can I make a similar
macro work on my Access report, or is there another way?
Here is my VB code for the Word button:
Thanks
Sammie

Sub Acrobat()
'
' Acrobat Macro
' Macro recorded 2/23/2005 by Sammie
'
ActivePrinter = "Adobe PDF"
Application.PrintOut filename:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
ActivePrinter = "hp LaserJet 1300 PCL 6"
End Sub
 
E

Ed

Hows this? create an identical report with its page property set to print to
acrobat printer. Then make a shortcut on the tool bar titled to print report
in acrobat or something so when the report opens its default is adobe. or
set the tool to direct print instead of previewing report. I use something
so when I print acrobat, before the report opens the macro copies the title
and report id to clipboard so when the acrobat dialog appears i just paste
the indo in the save as box.
 
M

Mark Andrews

You could get the code to:
1. remember which printer is default, and switch the printer to the pdf
print driver
2. create a pdf file by printing the report to the driver using correct
registry settings.
3. switch the printer back to the default printer

We sell code for step 2. code for steps 1 and 3 is available out there
somewhere for free
I don't remember the exact access website. Email me at the rptsoftware
email if you can't find it
and you are interested in our product and I'll find the code for steps 1 and
3.

I did this exact same thing about 4 years ago, but was at a different job
and do not have the code anymore.

HTH,
Mark
RPT Software
http://www.rptsoftware.com




Sammie said:
Is there a way to create a customized button on my toolbar to print my
report to Adobe Acrobat, and then automatically change the printer back
to my default printer? I am not very familiar with macros in Access,
but I use Visual Basic all the time. I have created a macro in Word to
do what I want, and assigned it to a button there. Can I make a similar
macro work on my Access report, or is there another way?
Here is my VB code for the Word button:
Thanks
Sammie

Sub Acrobat()
'
' Acrobat Macro
' Macro recorded 2/23/2005 by Sammie
'
ActivePrinter = "Adobe PDF"
Application.PrintOut filename:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="",
PageType:=wdPrintAllPages, _
ManualDuplexPrint:=False, Collate:=True, Background:=True,
PrintToFile:= _
False, PrintZoomColumn:=0, PrintZoomRow:=0,
PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
ActivePrinter = "hp LaserJet 1300 PCL 6"
End Sub
=----
 
S

Sammie

Ed said:
Hows this? create an identical report with its page property set to print to
acrobat printer. Then make a shortcut on the tool bar titled to print report
in acrobat or something so when the report opens its default is adobe. or
set the tool to direct print instead of previewing report. I use something
so when I print acrobat, before the report opens the macro copies the title
and report id to clipboard so when the acrobat dialog appears i just paste
the indo in the save as box.
I'm trying your suggestion. In the On Page property of my report, I put
ActivePrinter = "Adobe PDF"
but it doesn't work. Am I in the right place or do I have the wrong code?
How can I create a report ID? I like your idea of automatically sending
a report ID to a clipboard. How do I write the macro?
Thanks. I'll look for your answer on Monday.
Sammie
 
S

Sammie

Mark said:
You could get the code to:
1. remember which printer is default, and switch the printer to the pdf
print driver
2. create a pdf file by printing the report to the driver using correct
registry settings.
3. switch the printer back to the default printer

We sell code for step 2. code for steps 1 and 3 is available out there
somewhere for free
I don't remember the exact access website. Email me at the rptsoftware
email if you can't find it
and you are interested in our product and I'll find the code for steps 1 and
3.

I did this exact same thing about 4 years ago, but was at a different job
and do not have the code anymore.

HTH,
Mark
RPT Software
http://www.rptsoftware.com






=----
I sent an email to your rptsoftware address - not sure if you received
it. Please confirm. I'd be interested in steps 1 - 3 - can't find this
code elsewhere. I'll look for your reply on Monday.
Thanks.
Sammie
 
E

Ed

Sammie: All done with macro. Dont know how to get the macro to you other
than making a sample database and exporting it to sample then email or post
for you. But the basics for a id would be to use a unique field that
pertains to the record of information your trying to print. I dont know what
your report is based on? and start print macro with: selecting the idfield -
copy - open reportpreview - when you hit print button it should bring up
acrobat dialog asking for a file name. Just right click in file name field
and paste the id. It creates a pdf file in the chosen folder with the name
as idfield. Then you can email or even fax the pdf file. I went through all
this because I fax (winfax) proposals to customers and winfax does not
include graphics from Access reports.
 
S

Sammie

Ed said:
Sammie: All done with macro. Dont know how to get the macro to you other
than making a sample database and exporting it to sample then email or post
for you. But the basics for a id would be to use a unique field that
pertains to the record of information your trying to print. I dont know what
your report is based on? and start print macro with: selecting the idfield -
copy - open reportpreview - when you hit print button it should bring up
acrobat dialog asking for a file name. Just right click in file name field
and paste the id. It creates a pdf file in the chosen folder with the name
as idfield. Then you can email or even fax the pdf file. I went through all
this because I fax (winfax) proposals to customers and winfax does not
include graphics from Access reports.
Ed,

I'd appreciate your continued help with this. First, I can't get my
Acrobat report to print. In the On Page property of my report, I put
ActivePrinter = "Adobe PDF"
but it doesn't work. Am I in the right place or do I have the
wrong/insufficient code?

Second, if you could post a sample database with that macro either to
the newsgroup or to my email (whatever works) that'd be great. I don't
have experience writing macros, and I haven't had any luck using help.
I'm not sure my hotmail will take the Access attachment. So in that
case, maybe you can help me with the macro:

In trying to write the macro, I've got GoToControl and OpenReport
figured out. I'm stuck on how to do the copy command. It isn't on the
drop-down list of actions.

Thanks for the help.
Sammie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top