Script for "Email" button

V

Valentina S.

Hello to everyone,

I'm new in InfoPath and I need some HELP!
I had to create a form with a "Send as Email" button; I did, but one
problem is that in field "TO:" I can see the first person whom I
entered, and in field "CC:" I can't see noone.
Please help me with this problem.
I'm very appreciate your help!

Here is my script:

function SendEmailBtn::OnClick(oEvent)
{
createEmail();
}


function createEmail()
{
var xmlAttendees = XDocument.DOM.selectNodes("/my:MeetingAgenda/my:Attendees/my:Attendee");
var xmlAttendee;
var xmlProjectName =
XDocument.DOM.selectSingleNode("/my:MeetingAgenda/my:project/my:projectName");
var xmlEmailAddressPrimary =
XDocument.DOM.selectSingleNode("/my:MeetingAgenda/my:Attendees/my:Attendee/my:address/my:EmailAddressPrimary");
var rgRecipients = new Array();

while (xmlAttendee = xmlAttendees.nextNode())
rgRecipients.push(getNodeValue(xmlAttendee.selectSingleNode("my:EmailAddressPrimary")));
try
{
var oEnvelope = XDocument.View.Window.MailEnvelope;
oEnvelope.To = getNodeValue(xmlEmailAddressPrimary);
oEnvelope.CC = rgRecipients.join(" ;");
oEnvelope.Subject = getNodeValue(xmlProjectName);
oEnvelope.Visible = true;
}
catch (ex)
{
XDocument.UI.Alert(ex.description);
}

}

Thanks Alot.
Valentina
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top