Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 500
  • Last Modified:

JavaScript doesn't put subject in email with Adobe Acrobat 9

We just upgraded from Adobe Acrobat 8 Pro to version 9.  We have a document that uses javascript to email the .pdf to other people when it is digitally signed.  In Actrobat 8, the subject line was automatically filled in to be "Document_name.pdf - Adobe Acrobat Professional".  Now the email still comes up, but it doesn't automatically fill in the subject.  I have included the line of code in question.  Is there a way to change the javascript to put the document name in the subject line?  Thanks for your help.
this.mailDoc(false, "pendingOPS@navy.mil","", "", "", "Signed by NetOps.  Forwarded for Final review and Approval.")

Open in new window

0
laugle
Asked:
laugle
  • 4
  • 3
1 Solution
 
mohan_sekarCommented:
Yes, the 5th parameter is for the 'Subject'

this.mailDoc(false, "pendingOPS@navy.mil","", "", "This is email subject", "Signed by NetOps.  Forwarded for Final review and Approval.")
0
 
laugleAuthor Commented:
OK -- but our document has a different name each time it is sent out, and I don't want to change the code every time.  What code do I use to get it to put each different document's name in the subject line?  For example, in MS Active Directory, when you are creating a home directory, you can use the generic string %username% to specify a directory with the user's specific username.  Is there some code in Adobe that does something like this?  Or do you know what changed in Adobe 9 that stops the program from doing this automatically?  Is there some setting that will bring this functionality back?  Thanks again for any help.
0
 
mohan_sekarCommented:
document.documentFileName() will get you the document name. Then, the statement changes to

this.mailDoc(false, "pendingOPS@navy.mil","", "", document.documentFileName() + " - Adobe Acrobat Professional", "Signed by NetOps.  Forwarded for Final review and Approval.")
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
laugleAuthor Commented:
I have tested this on my document.  I have tested just putting a constant in the parameter, and that works.  When I put document.documentFileName() in the 5th parameter, the mail message will not come up.  I also tried to set a variable using var filename=document.documentFileName(); and then using the variable filename as the parameter, but the mail message won't come up with that either.  Somehow, my document will not recognize the code  document.documentFileName().  It's been a while since I've programmed in Java proper, but could this be failing because there is no API import statement at the start of the script?  I've never seen an import statement in an Adobe javascript -- is it possible to use an import statement?  If you want to see the whole javascript, I can attach it.
0
 
mohan_sekarCommented:
My bad. That API was for an older version of Adobe! Try this

this.mailDoc(false, "pendingOPS@navy.mil","", "", this.documentFileName + " - Adobe Acrobat Professional", "Signed by NetOps.  Forwarded for Final review and Approval.")
0
 
laugleAuthor Commented:
Thanks - that worked beautifully!  You're the best!
0
 
mohan_sekarCommented:
Glad I could help!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now