ChrisBelzona
Programmer
Hi
I have some code which I use in an Access Database to print .pdf (with Distiller). The code seems to open the pdf find the No of pages and prints them.
My problem is this I need to change the printer after it open the pdf (at the moment is just uses the default), I think I can do this from MSAccess, but think it could be easier from the code but I'm not sure. the code is below.
Any Help would be great
Sub PrintAllAcrobatDocsInDir(strFileName As String)
Dim AcroExchAVDoc As Object, AcroExchPDDoc As Object, _
AcroExchApp As Object
Dim iNumberOfPages As Integer
Set AcroExchApp = CreateObject("AcroExch.App"
Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc"
Set AcroExchPDDoc = CreateObject("AcroExch.PDDoc"
' Open the [strFileName] pdf file
AcroExchAVDoc.Open strFileName, ""
' Get the PDDoc associated with the open AVDoc
Set AcroExchPDDoc = AcroExchAVDoc.GetPDDoc
' Get the number of pages for this pdf [and subtract one as zero based]
iNumberOfPages = AcroExchPDDoc.GetNumPages - 1
' Print all pages in this document
AcroExchAVDoc.printPages 0, iNumberOfPages, POSTSCRIPT_LEVEL, True, False
' Close this file
AcroExchAVDoc.Close True
AcroExchApp.Exit
End Sub
I have some code which I use in an Access Database to print .pdf (with Distiller). The code seems to open the pdf find the No of pages and prints them.
My problem is this I need to change the printer after it open the pdf (at the moment is just uses the default), I think I can do this from MSAccess, but think it could be easier from the code but I'm not sure. the code is below.
Any Help would be great
Sub PrintAllAcrobatDocsInDir(strFileName As String)
Dim AcroExchAVDoc As Object, AcroExchPDDoc As Object, _
AcroExchApp As Object
Dim iNumberOfPages As Integer
Set AcroExchApp = CreateObject("AcroExch.App"
Set AcroExchAVDoc = CreateObject("AcroExch.AVDoc"
Set AcroExchPDDoc = CreateObject("AcroExch.PDDoc"
' Open the [strFileName] pdf file
AcroExchAVDoc.Open strFileName, ""
' Get the PDDoc associated with the open AVDoc
Set AcroExchPDDoc = AcroExchAVDoc.GetPDDoc
' Get the number of pages for this pdf [and subtract one as zero based]
iNumberOfPages = AcroExchPDDoc.GetNumPages - 1
' Print all pages in this document
AcroExchAVDoc.printPages 0, iNumberOfPages, POSTSCRIPT_LEVEL, True, False
' Close this file
AcroExchAVDoc.Close True
AcroExchApp.Exit
End Sub