I want to distribute several PDFs that contain normal written text and within that, there are several VBA-Listings. To make it easy for the reader, I want to add a button "Copy Listing to clipboard", so that you can simply paste the listing into the VBA IDE.
How can I do that?
I guess one way is to deposit each listing (there a lots...) behind separate buttons. A listing is just a text file like:
Private Sub btnBerEinfg_Click()
On Error Resume Next
Set ctl = Screen.PreviousControl
End Sub
Another way might be to embed each listing as a TXT/RTF-File and copy that content via button to the clipboard. Sounds a bit more complex.
Any idea? Thanks!
app.execMenuItem("Copy");
But, scripts in a document are restricted to menu items that are on the "White List". I'm not sure if "Copy" is on the white list by default, but it's worth a try.
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script