drom
Well-known Member
- Joined
- Mar 20, 2005
- Messages
- 543
- Office Version
- 2021
- 2019
- 2016
- 2013
- 2011
- 2010
- 2007
Hi and thanks in advance!!
If Ï use th following link
How To Count The Page Numbers Of Pdf Files In Excel?
I get the desired page number but is there a way to read in every PDF page for a KeyWord (eg:country) and get the different countries in a PDF file
I do not know the Acrobat are using my working mates (and here is were I get my problems)
And when I use to open the PDF file in word to get the countries...
When I use:
for wLine I get very rare strings like:
My PDF's are not protected, photos...
Any Help ?
If Ï use th following link
How To Count The Page Numbers Of Pdf Files In Excel?
I get the desired page number but is there a way to read in every PDF page for a KeyWord (eg:country) and get the different countries in a PDF file
I do not know the Acrobat are using my working mates (and here is were I get my problems)
And when I use to open the PDF file in word to get the countries...
- Takes to long because the PDF files are huge
- Works fine but takes too much time
When I use:
VBA Code:
Const Form_FileName As String = "C:\WordWideEmployees.pdf" 'Could contain over 350 pages
Sub AAA()
On Error Resume Next
Dim fso As New FileSystemObject
Dim wStream As TextStream: Set wStream = fso.OpenTextFile(Form_FileName, ForReading, False)
Dim wLine As String
Dim wKey As String: wKey = "Country" 'Contry is located in every page, so once found I can get the countries like: Spain, France...
Dim aCountry_List() As Variant
Dim xArrayIndex As Integer
Dim xRow As Integer
Do While Not wStream.AtEndOfStream
wLine = "": wLine = wStream.ReadLine
If wLine <> "" Then
'Debug.Print wLine
If InStr(wLine, wKey) > 0 Then
xArrayIndex = xArrayIndex + 1: ReDim Preserve aCountry_List(1 To xArrayIndex)
aCountry_List(xArrayIndex) = mid ( wLine,7,50) 'Not real but for this eg I do not care
'Debug.Print wLine
End If
End If
Loop
For xRow = UBound(aCountry_List) To LBound(aCountry_List)
if xRow =0 then exit sub
Debug.Print xRow, aCountry_List(xRow)
Next xRow
End Sub
for wLine I get very rare strings like:
- /Length1 123180
- /Type /Stream
- >>
- stream
- xœì½ xEþ7þêžÉ\Éœ™#“¹2™É1™Ü áä’+"DA@ð>@]Eï\o
- —†€‚ŠëÉzëzìŠ.¢«â‰¬É¼Ÿê™ uwÿÿû>Ïû<ïvQߪ®ª®®þÞßêž@Œˆl ?????????????????????????????????????????????????????????????????????????p????????????????-????????????????????????????????????????????????????????????????????-??????????????????????O??????????????????????????????????????????????????????????????????????????????????????????????????°???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????Z??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????‰????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????
- šA¯èãl›C€7ŽR˜Ka)©‹{òàÝ3¨?ð¼³W~Wlgí®Rø
My PDF's are not protected, photos...
Any Help ?