This is driving me nuts!
I am trying to do the simple bit as in just get a button to send the body in the email (although I would like to format it also, hence why I chose this post).
However I can;t even get the first bit right and have tried inserting about 4 lots of code from different posts on the subject and none of them work!
When I first pasted this one in it said i was missing a ';' on the CTRL81_7::OnClick(eventObj) line above so I added one but it's now saying I need one elsewhere:
This is an exact copy of what my code page looks like - what am I doing wrong?
/*
* This file contains functions for data validation and form-level events.
* Because the functions are referenced in the form definition (.xsf) file,
* it is recommended that you do not modify the name of the function,
* or the name and number of arguments.
*
*/
// The following line is created by Microsoft Office InfoPath to define the prefixes
// for all the known namespaces in the main XML data file.
// Any modification to the form files made outside of InfoPath
// will not be automatically updated.
//<namespacesDefinition>
XDocument.DOM.setProperty("SelectionNamespaces", 'xmlns:my="http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-12-04T13:29:03"');
//</namespacesDefinition>
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function mailMessage(to,subject,cc,body,bcc)
{ try
{ var myOlApp = new ActiveXObject("Outlook.Application");
newMail = myOlApp.CreateItem(0);
newMail.To = to;
newMail.Subject = subject;
newMail.CC = cc;
newMail.BCC = bcc;
newMail.Body = body;
newMail.Send();
}
catch(ex){
XDocument.UI.Alert(ex.description);
}
}
CTRL81_7::OnClick(eventObj);
{
mailMessage ("
[email protected]","Hallå","",XDocument.DOM.xml,"");
}
// Write your code here
}
//=======
// The following function handler is created by Microsoft Office InfoPath.
// Do not modify the name of the function, or the name and number of arguments.
//=======
function CTRL1_5::OnClick(eventObj)
{
// Write your code here
}
Help!