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

this.mailDoc object version dependant?

EggsBenedict
Registered: Dec 11 2006
Posts: 4

I am trying to use the follwing code in a 7.0.4 Designer form:
 
this.mailDoc({
bUI: false,
cTo: "apstory [at] ap [dot] com",
cCC: "dpsmith [at] ap [dot] com",
cSubject: "The Latest News",
cMsg: "A.P., attached is my latest news story in PDF."
});
 
The code is a copy from the 7.0.5 Jscript Reference. When I execute the code I get this error in the debugger:
 
TypeError: this.mailDoc is not a function
21:XFA:form1[0].#subform[0].EmailSubmitButton1[0]:click

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The reason this code doesn't work is because in an XFA (i.e. LiveCycle Designer) doc the meaning of "this" is different. "this" points to the current object (probably the button where your code lives), not the document. Instead use "event.target". So your code should read:

event.target.mailDoc();

Thom Parker
WindJack Solutions
[url=http://www.windjack.com]www.windjack.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://partners.adobe.com/public/developer/en/acrobat/sdk/
pdf/javascript/AcroJS.pdf]Acrobat JavaScript Reference[/url]

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

djfixxx
Registered: Mar 22 2007
Posts: 111
I am trying to get 2 emails from a variable in the cc field, can you help with this script?
The w.value and x.value aren't working for cc

var w = this.getField ("Landslide.0");
var x = this.getField ("CRM.1");
var s = this.getField ("market.0");
var t = this.getField ("UsersName");
var u = this.getField ("UsersTitle");
var v = this.getField ("Department");

this.mailDoc(true, "support [at] company [dot] com",w.value+x.value,"",s.value+t.value+u.value+v.value,"Please review this Access Request. Thank You"
);

It professional, networking, technical, graphical, imaging, froms.

djfixxx
Registered: Mar 22 2007
Posts: 111
Nevermind I had to reset the form and all worked when I put in the +";" + which wasn't working either.

It professional, networking, technical, graphical, imaging, froms.