Skip to main content
vwalla
Participant
November 15, 2018
Answered

Javascript toolbar button to email with filename as subject

  • November 15, 2018
  • 1 reply
  • 776 views

Anyone have a javascript code that will attach an email as normal (via the email button) and add the subject line as the filename?  I would like this to be a button on the toolbar.  I'm using acrobat 9.  Thanks!

This topic has been closed for replies.
Correct answer try67

Find the application's JavaScripts folder (probably something like: C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Javascripts), create a .js file in it, and place the following code in that file:

app.addToolButton({ cName: "CustomSendEmail", cLabel: "Attach to Email", cTooltext: "Attach to Email",

    cExec: "this.mailDoc({cSubject: this.documentFileName});", cEnable: "event.rc = (event.target != null);"});

Restart the application and the button should appear in your toolbar.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
November 15, 2018

Find the application's JavaScripts folder (probably something like: C:\Program Files (x86)\Adobe\Acrobat 9.0\Acrobat\Javascripts), create a .js file in it, and place the following code in that file:

app.addToolButton({ cName: "CustomSendEmail", cLabel: "Attach to Email", cTooltext: "Attach to Email",

    cExec: "this.mailDoc({cSubject: this.documentFileName});", cEnable: "event.rc = (event.target != null);"});

Restart the application and the button should appear in your toolbar.

vwalla
vwallaAuthor
Participant
November 15, 2018

YES!  Thank you!  Worked perfect!