-
Why cannot print PDF
Could anyone help to see why i cannot printout! Thanks!
Call AcroAVDoc.PrintPages(0, pageNo, 2, 1, 1) is not working!
Code:
Sub Checkfigures()
Application.ScreenUpdating = False
Dim searchString As String
Dim blnSearch As Boolean
Dim AcroApp As Acrobat.CAcroApp
Dim AcrobatDoc As Acrobat.CAcroPDDoc
Dim AcroAVDoc As Object
Dim pageNo As Integer
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet2")
Dim a As Integer
Set AcroApp = Nothing
Set AcrobatDoc = Nothing
Set AcroAVDoc = Nothing
Set AcroApp = CreateObject("AcroExch.App")
Set AcrobatDoc = CreateObject("AcroExch.PDDoc")
AcroApp.Show
AcrobatDoc.Open (ws.Cells(1, 1).Value)
Set AcroAVDoc = AcrobatDoc.OpenAVDoc("")
For a = 2 To 6
searchString = ws.Cells(a, 4).Value
blnSearch = AcroAVDoc.FindText(szText:=searchString, _
bCaseSensitive:=False, _
bWholeWordsOnly:=True, _
bReset:=2)
Set pdDoc = AcroAVDoc.GetPDDoc()
Set jso = pdDoc.GetJSObject
pageNo = jso.pageNum
Call AcroAVDoc.PrintPages(0, pageNo, 2, 1, 1)
Next a
AcrobatDoc.Close
AcroApp.CloseAllDocs
AcroApp.Exit
Application.ScreenUpdating = False
End Sub
-
Hello Clif, you suggested that Call AcroAVDoc.PrintPages(0, pageNo, 2,1,1) is not working but supplied the code for the Sub CheckFigures module. Within that module you call the sub routine AcroAVDoc.PrintPages(0,2,1,1). Which sub routine is causing the issue?
-
From what I can see this line
Code:
Call AcroAVDoc.PrintPages(0, pageNo, 2, 1, 1)
should be
Code:
AcroAVDoc.PrintPages(0, pageNo, 2, 1, 1)
you don't need to use Call there as that is for transferring control to subprocedures and not methods of objects.
-
Quote:
Originally Posted by
jdelano
From what I can see this line
Code:
Call AcroAVDoc.PrintPages(0, pageNo, 2, 1, 1)
should be
Code:
AcroAVDoc.PrintPages(0, pageNo, 2, 1, 1)
you don't need to use Call there as that is for transferring control to subprocedures and not methods of objects.
It show error, how to solve it
-
I'm guessing that when you set this
Code:
.Set AcroAVDoc = AcrobatDoc.OpenAVDoc("")
. Does it hold a value?