Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Acrobat: change selected text?

Status
Not open for further replies.

sthurlock

Programmer
Nov 25, 2002
2
US
This seems like it should be easy: loop through text in a pdf file, find a word and then change it. Thank you for any help you can give! -sthurlock

'example look for word "hello" then change to "goodbye"
Code:
If pdDoc.Open("c:\test\test.pdf") Then
  jso = pdDoc.GetJSObject
  If Not jso Is Nothing Then
    count = jso.getPageNumWords(0)
    For i = 0 To count - 1
       word = jso.getPageNthWord(0, i)
       If StrComp(word, "Hello", CompareMethod.Text)=0 Then
          jso.selectPageNthWord(0, i)
' HOW TO CHANGE SELECTED HERE?????
Code:
       End If
    Next i
    'then save and close doc    
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top