Help...Email Button using VB Script???

S

Scott

Does anyone know how to create a button on a form using VB that essentially
calls the 'Send to Mail Recipient' option? I've seen code that works for
Jscript (see below), but nothing for VB.

Thanks

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



function createEmail()
{
var xmlContributors =
XDocument.DOM.selectNodes("/iss:issue/iss:contributors/iss:contributor");
var xmlContributor;
var xmlTitle = XDocument.DOM.selectSingleNode("/iss:issue/iss:title");
var rgRecipients = new Array();

while (xmlContributor = xmlContributors.nextNode()
rgRecipients.push(getNodeValue(xmlContributor.selectSingleNode("iss:emailAddressPrimary")));

try
{
var oEnvelope = XDocument.View.Window.MailEnvelope;

oEnvelope.To = rgRecipients.join("; ");
oEnvelope.Subject = getNodeValue(xmlTitle);
oEnvelope.Visible = true;
}
catch (ex)
{
XDocument.UI.Alert(ex.description);
}
}
 
M

mitulmk

Hi, Scott,

The VB .Net equivalent of the code below should work just fine in
InfoPath SP1.
Note that if you're using InfoPath 2003, you'll have to use either
JScript or VBScript, whereas InfoPath 2003 SP1 also supports VB .Net
and C#.

Thanks,
Mitul.
 
S

Scott

I am using Infopath 2003 SP2. Where would I find the equivolent code? I have
a form currently coded in VB script and the only solution I have found was
written in JScript.
Thanks
 
M

mitulmk

Scott,
I'm not sure where you got this code from, but unless they have a VB
equivalent, you'll pretty much have to convert this code yourself. If
you understand the JScript below, it should be pretty trivial to
convert to VB,
Thanks,
Mitul.
 

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

Similar Threads

database email list 0
Script for "Email" button 0
Send E-mail 1

Top