Copy link to clipboard
Copied
The code transfers all the values from the PDF file into my Excel sheet .... I thought so .... On page 2 and following, after two-thirds of the page the enumeration ends and it continues on the next page ... On page 1 but everything is transferred .... has anyone ever had the phenomenon? I need all the text from the PDF
Set jso = PDDoc.GetJSObject
i = 0
For iPage = 0 To PDDoc.GetNumPages - 1
icount = jso.getPageNumWords(0)
For iWord = 0 To icount - 1
word = jso.getPageNthWord(iPage, iWord, True)
If VarType(word) = vbString Then
Tabelle5.Cells(i + 1, 1) = word
i = i + 1
End If
Next iWord
Next iPage
Set PDDoc = Nothing
Set jso = Nothing
greetings tobi
Use this:
icount = jso.getPageNumWords(iPage)
Copy link to clipboard
Copied
Why not just use saveAs() method to have Acrobat write out an Excel file for you?
Copy link to clipboard
Copied
That's just part of an extensive code.
I have a sheet with numbers in column A.
Now I open one after the other PDF files and search in these for the numbers from my sheet. For this purpose, the code transfers the text from the PDF files to an auxiliary sheet in column A, where it searches for the term and then goes up; search for more terms and transfer them to my sheet.
Then he deletes the contents in the auxiliary sheet and transmits the data from the next PDF file .... simply said ...
These are then for the first recording about 2900 PDF files and then so weekly about 50
If I export to Excel now, I can imagine that this takes more time and can not find a proper search for my terms instead. At any rate, I have no real idea
Copy link to clipboard
Copied
In your code you look only for the number of words on the first page.
Copy link to clipboard
Copied
Hallo Bernd,
aber er speichert fast alle Texte jeder Seite in Spalte A meines Hilfs-Sheets... Er fängt bei Seite 2 und folgende dann an, nur noch 2/3 zu übertragen und lässt den unteren Abschnitt komplett aus.
Was müsste ich denn anpassen?
Copy link to clipboard
Copied
Use this:
icount = jso.getPageNumWords(iPage)
Copy link to clipboard
Copied
Edit: Great! it works