Alfons1145
New Member
- Joined
- Mar 23, 2022
- Messages
- 3
- Office Version
- 365
- Platform
- Windows
Hello all together!
I am trying to solve the problem described in the topic. I have thousands of PDF files that contain a value after a string, I would like to copy this value into an excel file.
OPTION 1
I found this very helpful little script that allows to check whether a sting is included in the PDF in general: Search For String In PDF Using VBA
I thought great, that is almost what I need, I will just extend the selection and copy the characters after the string I am looking for. But I did not manage to do that and I wonder if it is at all possible with AcroExch.AVDoc.
OPTION 1 QESTION: Is someone able to tell me how to modify the section
To in fact select that string and the following characters and copy that to excel?
OPTION 2
The other solution I tried was what I found on this forum from people with similar problems: Extract data from .PDF
Here word opens the PDF and copies the whole content into excel. This seems to take much longer since the process includes way more work, so I would prefer option 1 even though I do not know if possible at all.
For option 2 to work I would need to simply change the following section (which I am not capable of, and require your help ?) :
OPTION 2 QUESTION B: Can someone tell me how to change this section to instead of selecting the whole story - find a string within the whole story and select the following few characters and then copy that into a new line in excel and not a new sheet for each PDF that has been scanned.
I hope this is all the information needed - it is the first time I post on here. I have gotten lots of help and tips from this platform already and am so impressed by you guys
Thanks very much for any help!
I am trying to solve the problem described in the topic. I have thousands of PDF files that contain a value after a string, I would like to copy this value into an excel file.
OPTION 1
I found this very helpful little script that allows to check whether a sting is included in the PDF in general: Search For String In PDF Using VBA
I thought great, that is almost what I need, I will just extend the selection and copy the characters after the string I am looking for. But I did not manage to do that and I wonder if it is at all possible with AcroExch.AVDoc.
OPTION 1 QESTION: Is someone able to tell me how to modify the section
Excel Formula:
blnSearch = AVDocObj.findtext(szText:=searchString, _
bCaseSensitive:=False, _
bWholeWordsOnly:=True, _
bReset:=2)
To in fact select that string and the following characters and copy that to excel?
OPTION 2
The other solution I tried was what I found on this forum from people with similar problems: Extract data from .PDF
Here word opens the PDF and copies the whole content into excel. This seems to take much longer since the process includes way more work, so I would prefer option 1 even though I do not know if possible at all.
For option 2 to work I would need to simply change the following section (which I am not capable of, and require your help ?) :
Excel Formula:
wdRange.WholeStory
wdRange.Copy
Set ShtPdfData = ThisWorkbook.Worksheets.Add
ShtPdfData.PasteSpecial Format:="HTML", Link:=False, DisplayAsIcon:=False, NoHTMLFormatting:=True
Application.Goto ShtPdfData.Range("A1")
OPTION 2 QUESTION B: Can someone tell me how to change this section to instead of selecting the whole story - find a string within the whole story and select the following few characters and then copy that into a new line in excel and not a new sheet for each PDF that has been scanned.
I hope this is all the information needed - it is the first time I post on here. I have gotten lots of help and tips from this platform already and am so impressed by you guys
Thanks very much for any help!