Quantcast
Channel: Adobe Community : Popular Discussions - JavaScript
Viewing all articles
Browse latest Browse all 12130

Using Excel VBA to save PDF file as a text (plain) file?

$
0
0

I'm using 8.0 Acrobat Pro.

 

Third party apps are not an option (I'm restricted from installing anything on my office PC).

 

I could simply save each PDF manually, but given the number of files this would not be practical.

 

The text it will output does not have to be pretty by any means (and I'm aware it won't be).

 

As long as I can get the PDF files in a text file format, there would be no further obstacles for me - because I would then be able to get Excel to gather-import all the data and consolidate-clean-organize everything accordingly at that point.

 

What's in these PDF files are simply names, numbers, and email addresses (basic office text type data stuff simple).

 

I wish to save them all as text files, and then use Excel to suck all the data from those newly created text files and consolidate-organize them accordingly.

 

The VBA module I've seen referrenced around the web is the following beneath; however, I am having no luck with it.

 

 

 

I keep getting the error message:

ActiveX component can't create object or  return reference to this object (Error 429)

 

I am running Microsoft Office 2010 | Excel (and using Adobe Acrobat Pro 8.0).

 

Any help is extremely appreciated.

 

Here is the VB code in Excel I'm having trouble with:  What this is supposed to do is simply find the specified PDF file and save it as a Plain Txt File.

 

 

Sub Convert_PDF_To_Text_File()

'---------------------------------

Dim AcroXApp As Object

Dim AcroXAVDoc As Object

Dim AcroXPDDoc As Object

 

Set AcroXApp = CreateObject("AcroExch.App")

AcroXApp.Hide

 

Set AcroXAVDoc = CreateObject("AcroExch.AVDoc")

AcroXAVDoc.Open strPDFPath, "Acrobat"

AcroXAVDoc.BringToFront

 

Set AcroXPDDoc = AcroXAVDoc.GetPDDoc

 

Dim jsObj As Object

Set jsObj = AcroXPDDoc.GetJSObject

 

jsObj.SaveAs strOutputFile, "com.adobe.acrobat.plain-text"

 

AcroXAVDoc.Close False

AcroXApp.Exit

'---------------------------------

End Sub


Viewing all articles
Browse latest Browse all 12130

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>