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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acrobat

Status
Not open for further replies.

Phailak

Programmer
Apr 10, 2001
142
CA
Hail,

I need to print a acrobat document from VB, how would I go about doing that (for now I add component acrobat reader but it's a hassle, is there a way to do it through set object or something???)

Phailak
 
This works but I am running a full edition of Acrobat (if you need help; select Acrobat as a reference through the VBE 'Tools>References' Menu and then you can browse its functions through F2(Object Browser))

Set pdDoc = CreateObject("AcroExch.AVDoc")
Call pdDoc.Open("MyFile.pdf", szTarget)
bOK = pdDoc.PrintPages(nFirstPage As Long, nLastPage As Long, nPSLevel As Long, bBinaryOk As Boolean, bShrinkToFit As Boolean) As Boolean

[e.g.: bOK = pdDoc.PrintPages(0,10,1,True,True)]

pdDoc.Close (True)
Set pdDoc = Nothing
 
Hail,

Works great thanx a million, would you know how I could choose the printer with same method???

Phailak
 
As far as I can tell it uses whichever printer Acrobat has set as its default. Do you want to alter this through VBA?
 
Sorry for the delay, I can't find any way to alter the Acrobat printer through VBa so you may just have to ensure that the Acrobat PrintSettings are correct before running your code.

:(
 
Hail,

Thanx for trying to help, when I set it for Acrobat, can I set default printer only for Acrobat and leave default printer of the cpu to what it was. Ex:

Printer uses as default: LaserJet 5

Can I configure Acrobat on that station to use 'Lightning FAX' (driver for fax server) but leave LaserJet 5 for all other applications?

Phailak
 
...and I thought we'd got the hard bit out of the way...

The only way I can find to do this is to set your WIndows default printer to 'Lightning FAX' so that Acrobat prints to it and use VBA to alter the Excel printer programtically (Application.CurrentPrinter = "MyPrinter")

Its not ideal but it does provide a solution.

Store300
 
Thanx,

Actually that's how I have it setup... but the agents complain when they always have to look out for the printer???(They print from other stuff like print screens and such) I was only trying to make it easier on them.

Thanx again

Phailak
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top