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

How to change the name of the attachment in an email

the_muth
Registered: Sep 8 2010
Posts: 1

Hello,

I am able to send out an email from my PDF by using a submit button. I use the following javascript for it:

var vMailToAddress = "Leon [dot] Boeijen [at] nl4b [dot] com"; //Mandatory
var vMailCcAddress = ""; //Optional
var vMailBccAddress = ""; //Optional
var vMailSubject = "This is a copy of your pdf"; //Optional
var vMailBody = ""; //Optional, Within the body use "%0A" for a new line,
// use "%0A%0A" for a new line preceded by a blank line (paragraph)

var vTarget = "mailto:" + vMailToAddress + "?subject=" + vMailSubject + "&body=" + vMailBody + "&cc=" + vMailCcAddress + "&bcc=" + vMailBccAddress;
this.resolveNode("#event").submit.target = vTarget;

And I have set the Send as option to 'PDF'.

This will send out an email with the full PDF as an attachment and uses the current pdf filename as the name of the attachement.

Only I want to change the name of the attached file based on data inside the PDF that can be set by the user.

Can anyone help me?

I use Adobe LifeCycle Designer ES 8.2 and am able to use FormCalc and Javascript.

Thanks in advance.

My Product Information:
Reader 9.3, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
:-( It can't be done. This one, and similar naming questions, get asked a lot. The only way to change the attachment name is to save the PDF to a different name before sending the email. Not very practical.


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