How to close the InfoPath in submit - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

How to close the InfoPath in submit

Last post 09-04-2007 12:57 AM by Shiva. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 08-29-2007 09:15 AM

    • cathy
    • Top 500 Contributor
    • Joined on 08-19-2007
    • Posts 38

    How to close the InfoPath in submit

    Hi,

    I want to close the InfoPath when the submit operation is over. I don't want to select it in "Submit Options".

    I wrote some code under submitbutton_click event. After performing this, my form must be closed. I tried Xmlform.Close() but it is not working.  How to close the infopath though code?

    Thanks 

     

     

    Filed under: ,
  • 08-29-2007 09:36 AM In reply to

    Re: How to close the InfoPath in submit

    Hey Cathy.

    Check out this post thread http://www.infopathdev.com/forums/p/3337/12505.aspx#12505

     

  • 08-29-2007 09:44 AM In reply to

    Re: How to close the InfoPath in submit

    Looking at your other posts and what you are trying to do.

    I was going to share that we have made buttons that look and feel like check boxes but are actually buttons so you can have them trigger submit etc.  That may make your life easier with that simple trick.  Which is just making the button have an image, or use wingdings to replicate a check and a box.  If you search you can find more info but just thought I would throw that in for ya.

  • 08-29-2007 04:50 PM In reply to

    • cathy
    • Top 500 Contributor
    • Joined on 08-19-2007
    • Posts 38

    Re: How to close the InfoPath in submit

     

     Hi,

    I tried to write one of the following lines, but the intellisense is not popping up.

    Application.XDocuments.Close(XDocument)
    Application.XDocuments.Close(0)
    XDocument.View.Window.Close(true);
    thisApplication.ActiveWindow.Close(true);

    I have added the reference to "Microsoft.Office.Interop.InfoPath.dll" to my application, even then it is not working.

    thanks

     



     

  • 08-29-2007 05:08 PM In reply to

    • cathy
    • Top 500 Contributor
    • Joined on 08-19-2007
    • Posts 38

    Re: How to close the InfoPath in submit

    One more point is now I am working on InfoPath 2007.

  • 08-29-2007 10:50 PM In reply to

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

    Re: How to close the InfoPath in submit

    Hi Cathy,

    I tried below the code in InfoPath 2007.

    Its worked for me and InfoPath form is closing when I click on button.

    XDocument.View.Window.Close(true);

    Can you add try and catch block to above statement and let you know what type of error it is giving?

    try

    {

    XDocument.View.Window.Close(true);

    XDocument.UI.Alert("The form has been successfully closed");

    }

    catch(Exception ex)

    {

    XDocument.UI.Alert(ex.Message);

    }

    Hope this helps you

  • 08-30-2007 05:53 AM In reply to

    • cathy
    • Top 500 Contributor
    • Joined on 08-19-2007
    • Posts 38

    Re: How to close the InfoPath in submit

    Hi Shiva,

    I tried it in try...catch.... it is giving the error at the compile time itself. The error is "An object reference is required for the nonstatic field,method,or property 'Microsfot.Office.Interop.InfoPath._XDocument2.View.get' ".....what does it mean?

    Thanks

     

     

  • 09-04-2007 12:57 AM In reply to

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

    Re: How to close the InfoPath in submit

    Hi Cathy,

    You are getting the error to get the XDocument.View object. Can you check once again have you imported InfoPath.dll? Can you uninstall your InfoPath and install it again.

    Hope this helps you.

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