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

Problem: " - Acrobat 9 Pro Extended.pdf" appended to filename

dcompto
Registered: Jul 15 2009
Posts: 3

Using Windows 7 and Acrobat 9 Pro Extended

Created AcroForm that has a Submit button with the following JavaScript on Mouse Up:

// Set the TO field
var cToAddr = "[MyUsername]@[MyDomain]";

// Set the SUBJECT LINE
var cSubLine = "MAE HazCom Quiz - " + this.getField("LastName").value + ", " + this.getField("FirstName").value

// Set the BODY
var cBody = "Attached is my completed HazCom Quiz."

// Send the form as a PDF attachment in an e-mail
this.mailDoc({bUI: true,cTo: cToAddr,cSubject: cSubLine,cMsg: cBody});

The attachment's filename is:

"MAE HazCom Quiz - [LastName].pdf"

When the Submit button is clicked, everything works as it should except the attachment's filename has changed to:

"MAE HazCom Quiz - [LastName].pdf - Acrobat 9 Pro Extended.pdf"

Anyone know how to fix this?

Thanks for any insight you can share.

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I'm not sure you can, Acrobat generates the attachment names automatically. You could try using the submitForm function to send the email.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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