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

Submit Email Button

koselj
Registered: Jul 9 2010
Posts: 4

Hello,

I have been trying to create a submit email button that alerts the user before they send the email, this is what I have so far:

var cResponse = app.alert ("Are you sure you want to submit this form?\n\nChoose YES to proceed or choose NO to go back and edit the form.",2,2);

if (cResponse ==4) {
if (nResponse ==1); {
this.mailDoc(true)
}}

This works, it makes a new email window pop up in Outlook, but I would like to autofill an email address. Below is what I have been trying to use with no luck.

var cResponse = app.alert ("Are you sure you want to submit this form?\n\nChoose YES to proceed or choose NO to go back and edit the form.",2,2);

if (cResponse ==4) {
if (nResponse ==1); {
this.mailDoc({
bUI: false,
cTo: me@mycompany,
cSubject: This Form,
cMsg: msgBody,
cSubmitAs: "PDF"
});
}}

Please let me know what to change. Thanks!

My Product Information:
Acrobat Standard 9.3.1, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Strings must be surrounded by quotes, like so (I assume msgBody is a variable defined somewhere else):
this.mailDoc({bUI: false,cTo: "me@mycompany",cSubject: "This Form",cMsg: msgBody});

EDIT: Just noticed there's no such parameter as cSubmitAs for this function. The file will always be attached as a PDF to the email created. I think you got it mixed up with submitForm().

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com