Copy link to clipboard
Copied
I have a invoice with an email button that will use to email a copy to my customers.
But when the attachment is sent the file name is random numbers and letters, not the same file name as the original pdf.
Is there a command that I can put in my script that will take data from the from (Invoice and Date) and use it for the file name when it sends the email?
This is the script I am using.
// Collect the Customer's Email Address
var cToAddr = this.getField("Email").value;
// Set the subject and body text for the email message
var cSubLine = "Paperwork"
var cBody = "Here is your paperwork."
// Send the first page as a file attachment in an email
var page0 = this.extractPages(0);
page0.mailDoc({bUI: true, cTo: cToAddr, cSubject: cSubLine, cMsg: cBody}); page0.closeDoc(true);
Copy link to clipboard
Copied
Since I wrote this code for you I'll chime in (PS. In the future it's better to ask follow-up questions in the original thread, instead of opening a new one).
The answer is that without installing a script on the local machine of the user it's not possible to change the file name, not automatically at least.
You can always prompt the user to save the file before submitting it, though.
Copy link to clipboard
Copied
Thank you,
In case anyone also has a problem with the random numbers and letters in the file name...it was because I had a space in the original file name.
Copy link to clipboard
Copied
What happens when you remove the space?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now