These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Button to Export to Excel by Copying Field to Clipboard and then Manually Pasting in Excel HELP!!

np
Registered: Jun 17 2011
Posts: 1

I have an idea about how to export out of Adobe Reader and I can get it to work by manually copying and pasting but I want to create a button to do it for me.
 
I heard maybe app.execMenuItem("Copy"); may have my answer but I can't get it to work.
 
Basically I have a button that uses javascript to put all the fields on the form into one field separated by Tabs (Tab Delimited). Then I can manually Click on that field and "Select All" and "Copy" and then Paste it right into Excel and it is ready to be imported into my database.
 
I want a button that will manually select everything in that one field (Hidden Field) and Copy it. Then I can go to Excel and Paste it.
 
Some Code for input
 
this.getField("AllData").value= this.getField("A").value + " "+this.getField("B").value + " "+this.getField("C").value ...
 
//Use windows command to Select All, then Copy .
app.execMenuItem("SelectAll").this.getField("AllData").value
app.execMenuItem("Copy").this.getField("AllData").value
 
Not sure how to do that. Please help. I am not an expert at this at all.
Thanks

My Product Information:
Acrobat Pro 10.0.2, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Not any more. For security reasons the clipboard copy and paste are not available to scripts.

There is however another way. Use the "Doc.exportAsText()" to write the data to a tab delimited text file, then import this file into excel. More details are provided here:Acrobat and Excel

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script