Field value to subject line - InfoPath Dev
in

InfoPath Dev

Field value to subject line

Last post 04-30-2009 07:42 AM by Crazy Vinnie. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 04-30-2009 06:59 AM

    Field value to subject line

    Beginner, using IP 2003

     

    I have added a button to email my form using a simple code.

     

    function SendEmailBtn::OnClick(Event)

    {

                var Email = Application.ActiveWindow.MailEnvelope;

               

                Email.To = "";

                Email.Subject = "";

                Email.Visible = true;

    }

     

    I need the subject line to populate from a text field within the form. I believe the path for the field is “/my:myFields/my:field6”. Being new to InfoPath, I could have this wrong.

     

    If anyone could edit my code to show me how to accomplish what I need that would be great.

     

  • 04-30-2009 07:09 AM In reply to

    Re: Field value to subject line

    Hi

    To set the data of field6 to Email subject 

    add below line

    Email.Subject = thisXDocument.DOM.selectSingleNode("/my:myFields/my:field6").text;

     

    Madhuri
    http://www.ggktech.com
  • 04-30-2009 07:36 AM In reply to

    Re: Field value to subject line

    I believe it would actually be

    Email.Subject = XDocument.DOM.selectSingleNode("/my:myFields/my:field6").text;

    without the "this," but otherwise that should work if the XPath is correct.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 04-30-2009 07:42 AM In reply to

    Re: Field value to subject line

    Thanks for the fast replies everyone. I came up with the same solution as Jimmy after reading Madhuri’s reply.

    Thanks a lot.

     

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.