Closing InfoPath with Code - InfoPath Dev
in

InfoPath Dev

Closing InfoPath with Code

Last post 11-15-2006 11:54 PM by Shiva. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 11-15-2006 08:28 AM

    Closing InfoPath with Code

    Hello:

    I have the following code from the good people on the InfoPath Microsoft forum:
    {
    if (XDocument.Errors.Count > 0)
    {XDocument.UI.Alert("Required information is missing as indicated by the red asterisk(s).") ;
    return;
    }
    try
    {
    XDocument.Submit()
    Application.ActiveWindow.Close(true);
    }
    catch(e)
    {
    XDocument.UI.Alert(e.description);
    }


    I need it in order to close InfoPath after submit. Is there any way to modify the Submit statement to submit to a specific data connection? I have one submitting to email and the other submitting to a Sharepoint forms library. I need to use this code, but specify which connection to use.

    Thanks so much!

    BTW, I'm not a programmer.

  • 11-15-2006 10:05 AM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Closing InfoPath with Code

    Hi Deb,

    Can you get the more information to submit the form to sharepoint,
    http://office.microsoft.com/en-us/infopath/HP011093021033.aspx

    Can you get more information on email submit,
    http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=3339
  • 11-15-2006 10:18 AM In reply to

    Re: Closing InfoPath with Code

    My data connections are already set up. What I need to know is how to submit to those connections through code. The code I pasted in the original post has the code I'm needing to modify.

    Thanks for your help!
  • 11-15-2006 11:54 PM In reply to

    • Shiva
    • Top 25 Contributor
    • Joined on 04-15-2005
    • India
    • Posts 694

    Re: Closing InfoPath with Code

    Hi Deb,

    You need to modify the url of the sharepoint address in manifest.xsf file or you need to modify the data connection of the sharepoint.
    In code it will take the sharepoint address from manifest.xsf file only. You no need to change your code.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.