|
You should to have fill version of Acrobat (not reader)
Take look on this procedure:
Sub test_with_PDF()
Dim objApp As Object
Dim objPDDoc As Object
Dim objjso As Object
Dim wordsCount As Long
Dim page As Long
Dim i As Long
Dim strData As String
Dim strFileName As String
strFileName = "C:\Temp\File.pdf"
Set objApp = CreateObject("AcroExch.App")
Set objPDDoc = CreateObject("AcroExch.PDDoc")
'AD.1 open file, if =false file is damage
If objPDDoc.Open(strFileName) Then
Set objjso = objPDDoc.GetJSObject
For page = 0 To objPDDoc.GetNumPages - 1
wordsCount = objjso.GetPageNumWords(page)
For i = 0 To wordsCount
'AD.2 Set text to variable strData
strData = strData & " " & objjso.getPageNthWord(page, i)
Next i
Next
MsgBox strData
Else
MsgBox "error!"
End If
End Sub
|
|