Auto Close Infopath Application - InfoPath Dev
in

InfoPath Dev

Auto Close Infopath Application

Last post 06-26-2007 07:43 AM by Matt Faus. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-21-2007 08:01 AM

    • Bill
    • Top 200 Contributor
      Male
    • Joined on 09-26-2006
    • USA
    • Posts 57

    Auto Close Infopath Application

    Good Morning:

    I have to open approximately 4000 XML files, export some data and then close the XML file.  I can open the form just fine and I can export the data just fine; however, I can not auto close the file once the export of the data is completed.  I have tried the following commands:

    thisXDocument.View.Window.Close(True) & thisApplication.Quit(False)

    True) & thisApplication.Quit(False)

    The only way that I can get these two commands to work sucessfully is to put them behind a button control.  So, I am looking for any help on how to either call the on click event of the button control or another way to auto close the form.

    Any suggestions would be greatly appreciated.

    Thanks!

    Bill

     

    William L Fringer
    Database Administrator/Systems Integration Specialists

    L & S Associates, Inc.
    Michigan State University Corporate Research Park

    1-800-766-6185, ext 2076
  • 06-26-2007 07:43 AM In reply to

    Re: Auto Close Infopath Application

    Hi Bill and welcome to the forums!

    Are you sure you want to be doing all this batch processing from within InfoPath? It might be quicker for you to create a command-line application that that processes these 4000 files.

    To add the event handler in code, double-click the button control and click Edit Form Code.  This should switch you to your CS file and create the OnClick event that you can edit.  However, I think these functions will require Full Trust of the form, and that could be difficult.  Instead, you might want to add a Rule that closes the form after the button is clicked - this will not require Full Trust and therefore be much easier to deploy.

    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.