Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 688

Need to extract information from pdf fields from large document

$
0
0
I have a 320 page document. Each page has one fillable field on it that I need to extract the data from and input into an Excel sheet. My initial stab shows me the field name, but not the content of the field, and it also does not keep the fields in their order. Each field is labeled "undefined_" and then a sequential number. When I echo the field name using a For/Next loop, it sorts by the number's first integer, then the second, then the third.

For instance,

undefined_1
undefined_10
undefined_11
...
undefined_2

It is imperative that I keep the order that it is on the document. I can handle the export to excel myself, but this has just got me baffled.

Code:

Set wShell=CreateObject("WScript.Shell")
Set oExec=wShell.Exec("mshta.exe ""about:<input type=file id=FILE><script>FILE.click();new ActiveXObject('Scripting.FileSystemObject').GetStandardStream(1).WriteLine(FILE.value);close();resizeTo(0,0);</script>""")
sFileName = oExec.StdOut.ReadLine
                        Set gApp = CreateObject("AcroExch.app")
                        Set avDoc = CreateObject("AcroExch.AVDoc")
                        If avDoc.Open(strFileName, "") Then
                                Set PDFForm = CreateObject("AFormAut.App")
                                set x=PDFForm.Fields
                                For Each myField In x
                                        wscript.echo myField.Name
                                Next
                        End If
avDoc.Close (True)

Set gApp = Nothing
Set avDoc = Nothing
Set PDFForm = Nothing

Help is welcomed.

Viewing all articles
Browse latest Browse all 688

Trending Articles



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