

Many PDF viewers will have a different but similar method. For a string with spaces it needs quotes structural.pdf -search "N12 and N16" that can work on a line wrap or division (see above) but unlike Acrobat it can not search two nearby words unless there is clear space between them. Note for standalone single (portable) exe you need to call that first in command line but for my example above, it is using SumatraPDF as the default handler for. NOTE It can only be found :-) in the latest 3.4 pre-release, previously you would have had to script much as you do now. Now its not quite working because it has to activate the pdf window to send keys and highlight specifically.ĭisclaimer I support SumatraPDF so anywhere I can search a PDF by adding -search switch, that can be from an Xcell call filename or whatever. 'Type the search string in the find box that opens 'The second argument "true" implies that Excel will wait for the keys to be processed 'Send "CTRL + F" keys to the opened PDF to invoke find within that file

While DateDiff("5", waitTime, Now) & amp amp amp amp gt 2 'Wait time for a couple of seconds for the PDF file to fully load 'Open successful, bring the PDF document to the front. 'if your Excel and PDF are in separate folders If AVDoc.Open(PDFPath, "") = True Then 'Make sure to provide a complete path to the PDF here

'Your search string - case-insensitive, as in actual PDF search PDF_path = "C:\Users\User\Villaron\SBP Admin Sales - Documents\Clients\Neworks Pty Ltd (Formally PLN) (104)\2022-634 -1596 Sienna Wood, Neerigen Brook\estimating\rev0\structural.pdf" Here is the code I have Dim PDF_path As String I also added an image 'Highlight.PNG' as an attachment which shows the highlight icon of the toolbar.I know theres a lot of posts here regarding searching and finding text in pdf using vba, however that involves Adobe pro which I dont have. Make sure that you save the PDF file after all this because all the highlights will be gone if you do not save the file. Now, you can select any color you want to highlight the text and also some other properties like opacity etc. Select 'Properties' at the bottom of the menu popped now. If you want another color, right click on the text highlighted in yellow color. It will be highlighted in yellow color by default. Then, select the text you want to highlight. To do that, click highlight icon of the tool bar.

You can highlight text in all the PDF files except the ones which belong to above category. Therefore, you cannot highlight text in such PDF files. Some PDF files are made just by combining images i.e. The answer to your question depends on the type of PDF (Portable Document Format) in which you want to highlight text.
