473,581 Members | 2,789 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PDF only Prints first Page when using VBA to print from Acrobat 5

I have a MS Access data base that creates custom reports for clients
in PDF form then prints the reports after all client's reports have
been printed. The problem that I have run into is that when acrobat is
printing to my printer, I can get it to print only the first page of a
report(OPTION 1 BELOW) or it is spooled to the printer then deleted in
the print cue before it it printed (OPTION 2 BELOW).

It's been very frustrating trying to get these reports to print and
I've logged over 20 hours reading posts to see if anyone else was
having a similar problem. I'm using Acrobat 5 and an HP office jet
7130 printer. I have tried the DDE option of printing but it too has
some quirks that just are not acceptable.

Any help would be appreciated!

Chuck Reed
vb*@cox-internet.com

Option Explicit
Dim AcrDoc As CAcroAVDoc,AcrA pp as CAcroApp,AcroPD Doc As CAcroPDDoc
Sub testprintpdf()
OpenAcrobat
PrintPDFDoc "G:\Weekly Reports\ReportT emp\2\1Daily.pd f"
CloseAcrobat
End Sub

Private Sub OpenAcrobat()
Set AcrApp = CreateObject("A croExch.App")
AcrApp.Maximize 1
DoEvents
End Sub

Private Sub PrintPDFDoc(x As String)
Dim AcrDoc As CAcroAVDoc, lngPages As Long

Set AcrDoc = CreateObject("A croExch.AVDoc")
AcrDoc.Open x, "PDF Print"
DoEvents
Set AcroPDDoc = AcrDoc.GetPDDoc
lngPages = AcroPDDoc.GetNu mPages
'OPTION 1
AcrDoc.PrintPag es 0, lngPages, 1, True, True 'HERE THE PRINT QUE
DELETES AFTER SPOOLING IF I USE THIS COMMAND AND TELL IT HOW MANY
PAGES I'M PRINTING.
'OPTION 2
AcrDoc.PrintPag es 0, 0, 1, True, True 'ONLY PRINTS FIRST PAGE WITH
THIS OPTION.
DoEvents
AcrDoc.Close True
DoEvents
Set AcrDoc = Nothing
DoEvents
End Sub

Private Sub CloseAcrobat()
AcrApp.CloseAll Docs
AcrApp.Exit
Set AcrApp = Nothing
DoEvents
End Sub
Nov 13 '05 #1
3 10566
Chuck

What happens when you try

AcrDoc.PrintPag es 0, lngPages - 1, 1, True, True

Ron W

"Chuck Reed" <vb*@cox-internet.com> wrote in message
news:26******** *************** ***@posting.goo gle.com...
I have a MS Access data base that creates custom reports for clients
in PDF form then prints the reports after all client's reports have
been printed. The problem that I have run into is that when acrobat is
printing to my printer, I can get it to print only the first page of a
report(OPTION 1 BELOW) or it is spooled to the printer then deleted in
the print cue before it it printed (OPTION 2 BELOW).

It's been very frustrating trying to get these reports to print and
I've logged over 20 hours reading posts to see if anyone else was
having a similar problem. I'm using Acrobat 5 and an HP office jet
7130 printer. I have tried the DDE option of printing but it too has
some quirks that just are not acceptable.

Any help would be appreciated!

Chuck Reed
vb*@cox-internet.com

Option Explicit
Dim AcrDoc As CAcroAVDoc,AcrA pp as CAcroApp,AcroPD Doc As CAcroPDDoc
Sub testprintpdf()
OpenAcrobat
PrintPDFDoc "G:\Weekly Reports\ReportT emp\2\1Daily.pd f"
CloseAcrobat
End Sub

Private Sub OpenAcrobat()
Set AcrApp = CreateObject("A croExch.App")
AcrApp.Maximize 1
DoEvents
End Sub

Private Sub PrintPDFDoc(x As String)
Dim AcrDoc As CAcroAVDoc, lngPages As Long

Set AcrDoc = CreateObject("A croExch.AVDoc")
AcrDoc.Open x, "PDF Print"
DoEvents
Set AcroPDDoc = AcrDoc.GetPDDoc
lngPages = AcroPDDoc.GetNu mPages
'OPTION 1
AcrDoc.PrintPag es 0, lngPages, 1, True, True 'HERE THE PRINT QUE
DELETES AFTER SPOOLING IF I USE THIS COMMAND AND TELL IT HOW MANY
PAGES I'M PRINTING.
'OPTION 2
AcrDoc.PrintPag es 0, 0, 1, True, True 'ONLY PRINTS FIRST PAGE WITH
THIS OPTION.
DoEvents
AcrDoc.Close True
DoEvents
Set AcrDoc = Nothing
DoEvents
End Sub

Private Sub CloseAcrobat()
AcrApp.CloseAll Docs
AcrApp.Exit
Set AcrApp = Nothing
DoEvents
End Sub

Nov 13 '05 #2
"Ron Weiner" <we*********@mi ndspring.com> wrote in message news:<uH******* *******@TK2MSFT NGP12.phx.gbl>. ..
Chuck

What happens when you try

AcrDoc.PrintPag es 0, lngPages - 1, 1, True, True

Ron W

Ron,

This worked well. I've not found any documentation that discusses that
you have to reduce the page count by one. Thank you!
Nov 13 '05 #3
vb*@cox-internet.com (Chuck Reed) wrote:

AcrDoc.PrintPag es 0, lngPages - 1, 1, True, True
This worked well. I've not found any documentation that discusses that
you have to reduce the page count by one. Thank you!


The current IAC Reference says:

....
nFirstPage The first page to print. The first page in a PDDoc is
page 0.
nLastPage The last page to print. The first page in a PDDoc is page
0.

Perhaps not completely explicit but a clue.

(Anyone planning Acrobat development should consider the Acrobat SDK a
must. http://partners.adobe.com/asn/acrobat/docs.jsp. Only limited
documents are free).

----------------------------------------
Aandi Inston qu***@dial.pipe x.com http://www.quite.com
Please support usenet! Post replies and follow-ups, don't e-mail them.

Nov 13 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
2646
by: JayB | last post by:
http://www.fape.org/idea/what_idea_is/discipline_overview1.htm When I try to print this page in IE, each word is on it's own line. When I try to print in Firefox, it only prints out one page. I've validated the CSS and the HTML but I still can not find what is causing this problem Perhaps a fresh set of eyes can see what I missed? ...
1
2560
by: Martin | last post by:
Hi, I have an ASP page, whisch generates dynamic report for a SQL server DB. Now the users want to have the content in PDF format (not HTML page). The server machine had "adobe acrobat destiller" installed. How can I print the content of this ASP page to acrobat PDF destiller and send PDF file to browser? Thanks for help Martin
6
3312
by: Mike Conklin | last post by:
This one really has me going. Probably something silly. I'm using dcount for a report to determine the number of different types of tests proctored in a semester. My report is based on a parameter query which is the recordsource for the report. The parameter is <=. The query returns the correct amounts upto the date entered (no need for...
0
1186
by: John Mac | last post by:
I have a program that encapsulates the IE browser via the AxSHDocVw.AxWebBrowser technique. All works fine. It seems to me there should be a way to locate and wire up to an ActiveX/COM component on a page and call its methods directly - eg locating via the MSHTML document model. Has anyone done this please in C# ? The actual...
9
2498
by: jcvoon | last post by:
Hi: The following code work on win form application Dim faxServer As FAXCOMLib.FaxServer Dim faxDoc As FAXCOMLib.FaxDoc faxServer = New FAXCOMLib.FaxServerClass faxServer.Connect(Environment.MachineName)
0
899
by: janakiraman | last post by:
Hi I have a page in .net. It displays the details in a grid. I have a button to print the details. when the user clicks the print button, a pop up comes up with only the details to be printed. when the user clicks print it prints fine. This works fine when there is only one page to be printed. If suppose there are three pages to be printed...
6
20440
by: Filips Benoit | last post by:
Dear All, All 3 codes, copied from internet, triggers error 429 : ActiveX component can't create object ! No compile error. I have the reference set to Adobe Acrobat 7.0 Type Library I do not have the full version of Adobe Reader 7.0 ! The final goal is to print a PDF-file from access after selecting the file in a browser.
0
1184
by: GiftX | last post by:
Hellow everyone, I am calling/manipulating Excel spreadsheet through VB 6.0. Most of my objectives are accomplished except some cosmetics. Problem#1: For example, after running my program to process a single record, when I proceed to print it, it prints the first page containing the processed record. It also prints 5 more blank pages without...
1
12587
by: Tim Sprout | last post by:
I want to call Page Setup to set default printer and page size and orientation before batch printing pdf's silently from WebBrowser controls. I can print silently using DDE (the NDde library) or Adobe Interapplication Communication (IAC) DotNet API. There is no Adobe DDE command or IAC API for Page Setup. I don't see a print silent method for...
0
7882
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...
1
7914
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...
0
8181
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5683
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...
0
3809
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...
0
3835
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2309
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1410
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1145
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...

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.