Save time on writing and testing code by using the code below and use it in your application. If you want to implement this functionality, you should copy and paste code below into your app using code editor. Then compile and run your application. VBScript application implementation mostly involves various stages of the software development so even if the functionality works please check it with your data and the production environment.
If you want to try other samples for VBScript then free trial version of ByteScout PDF Suite is available on our website.
' Create Bytescout.PDFExtractor.TextExtractor object Set extractor = CreateObject("Bytescout.PDFExtractor.TextExtractor") extractor.RegistrationName = "demo" extractor.RegistrationKey = "demo" ' Get all files in folder Set objFSO = CreateObject("Scripting.FileSystemObject") Set objFolder = objFSO.GetFolder("..\..") Set colFiles = objFolder.Files ' Convert every PDF file to text For Each objFile In colFiles if objFSO.GetExtensionName(objFile) = "pdf" Then ' Load PDF file extractor.LoadDocumentFromFile objFile.Path ' Save extracted text to .txt file extractor.SaveTextToFile Replace(objFile.Name, "." & objFSO.GetExtensionName(objFile),".txt") ' Reset the extractor before load another file extractor.Reset End If Next