Putting Form Field Data in Envelope Fields - InfoPath Dev
in

InfoPath Dev

Putting Form Field Data in Envelope Fields

Last post 07-21-2010 05:19 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 07-21-2010 06:28 AM

    Putting Form Field Data in Envelope Fields

    I'm using Infopath 2003 SP3. I've written the following jscript code that is executed by a button I put on my form that opens the mail envelope and "embeds" the form into an email being sent by Exchange 2007.

    ffunction Send_Form::OnClick(eventObj)
    {
     {
    try { var oEnvelope = Application.ActiveWindow.MailEnvelope;
    oEnvelope.To = "[email protected] ;
    oEnvelope.CC = "[email protected]; [email protected]";
    oEnvelope.Subject = "Travel Request for I/S";
    oEnvelope.Visible = true;
    }
    catch(ex)
    {
     XDocument.UI.Alert(ex.description);
    }
     }
     }

    Now I want to grab specific fields in the form such as the To: field and CC: field and include them in the Envelope.To and Envelope.CC fields. I'd also like to concatenate the subject line with text and info from a field also in the form. Is this possible?

     

  • 07-21-2010 05:19 PM In reply to

    Re: Putting Form Field Data in Envelope Fields

    Hi Bo Nesbit,

    Why not just use the out-of-box Email data cnnector? Tools->Data Connections->Add->E-mail->... ? That's a lot easier and you don't have to maintain code.

    But, if you really want code, you can definitely do the same thing. There are lots of posts in this forum and information in the 2003 SDK (see InfoPath Resources link on left) that shows how to access the XML DOM from code.

    May your path be garden variety,

     

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.