Results 1 to 5 of 5

Thread: Why cannot print PDF

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Contributor
    Joined
    Nov 2009
    Posts
    114
    Location

    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!

    
    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
    Last edited by clif; 08-29-2023 at 11:37 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •