Email subject field help - InfoPath Dev
in

InfoPath Dev

Email subject field help

Last post 03-29-2009 09:42 PM by swathip. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-29-2009 09:05 AM

    • NCB737
    • Not Ranked
    • Joined on 03-29-2009
    • Posts 1

    Email subject field help

    Hello all, I am new to Infopath and have a slight problem with my form and
    hope you can help.

    I have a form with a 'submit' button and I would like to generate an email
    from the button. I would like to add the contents of a field from the form
    into the email subject field, which I can do using the 'submit using a data
    connection'. The problem is, I still want the user to be able to edit the
    body of the email and the 'to' field. I have the following code so far:

    function submit1::onclick(eventobj)
    {
    var objsubmit;

    objsubmit = application.activewindow.mailenvelope;
    objsubmit.to = "";
    objsubmit.subject = getnode("/my:myfields/my:entno").text;
    objsubmit.visible = true;
    objsubmit = null;
    }

    OR The preferred fuction

    function submit1::onclick(eventobj)
    {
    xdocument.ui.showmailitem("to (want to leave blank)", "", "", "Subject:" +
    (text from a control on my form), "email body");
    }

    Many thanks in advance.
  • 03-29-2009 09:42 PM In reply to

    Re: Email subject field help

    Hi and welcome to Forums,

    You can add an editable field on the form to enter the To value. Do the same for the body also. Use these fields in code same as Subject field. But the user cannot modify the To or any value while sending the Email.

    Swathip
    www.ggktech.com
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.