StrText = strText & objSelection.GetText(tCount) Set objSelection = objPage.CreatePageHilite(objHighlight)įor tCount = 0 To objSelection.GetNumText - 1 ObjHighlight.Add 0, 10000 ' Adjust this up if it's not getting all the text on the page Set objPage = objPDDoc.AcquirePage(pageNum) Make sure to add the Library to your references too (On my machine it is the Adobe Acrobat 10.0 Type Library, but not sure if that is the newest version)Įven with the Adobe library it is not trivial (you'll need to add your own error-trapping etc): Function getTextFromPDF(ByVal strFilename As String) As Stringįor pageNum = 0 To objPDDoc.GetNumPages() - 1 You can open the PDF file and extract its contents using the Adobe library (which I believe you can download from Adobe as part of the SDK, but it comes with certain versions of Acrobat as well) 'Application.Wait Now + TimeValue("00:00:2") Set openPDF = CreateObject("Shell.Application")Īpplication.Wait Now + TimeValue("00:00:2") ![]() ![]() What this does is essentially the same thing you are trying to do - only using Adobe's own library.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |