1 Reply Latest reply on Sep 17, 2009 4:49 AM by stud065

    text search result loop

    hm_arul Level 1
      Hi scripters,

      here I am searching text using vbscript, its working find. Now where I am struck using loop command for every search item, I am able to get the page no of first search item, i need to make this every search item.

      here is my code

      Private Sub Command1_Click()
      Dim gApp As Object
      Dim gAvDoc As Object
      Dim pdfpath As String
      Dim fctr As Integer
      Dim AVPage As Object
      Dim lngPage As Long

      pdfpath = "C:\ch07.pdf"
      Set gApp = CreateObject("AcroExch.App")
      gApp.Show
      Set gAvDoc = CreateObject("AcroExch.AVDoc")
      If gAvDoc.Open(pdfpath, "") Then
      'MsgBox ("Hi Shivaji")
      If gAvDoc.FindText("and", 1, 1, 1) = True Then
      Set AVPage = gAvDoc.GetAVPageView
      lngPage = AVPage.GetPageNum
      MsgBox ("Text found on this Page: " & (lngPage + 1))
      Set AVPage = Nothing
      Else
      MsgBox ("No text found")
      End If
      Else
      MsgBox ("No file open")
      End If
      End Sub

      please give me your ideas

      thanks in advance

      regards
      a r u l
        • 1. Re: text search result loop
          stud065

          Hi Arul, I found your posting :

           

          > text search result loop

          > "Hi scripters,

          > Here I am searching text using vbscript, its working find. Now where I am struck using loop command for every search item, I am able to get the

          > page no of first search item, i need to make this every search item."

           

          Have you ever solved the problem with this loop. Can you send me the code ?

          I am searching for a solution for the same problem.

          I try to make a hitlist for all the found texthits in a PDF. Then extract the coordinates (which works fine, there are some good snipplets for this)

          and in the end place a textformfield behind the Hits and fill them by an FDF File.

           

          But when there is more than one instance of the searchstring I can only find the first one.

           

          Thank you,

           

          Karsten from Germany