Quit Method
===========
Quits the Microsoft Office InfoPath 2003 application.
expression.Quit
expression Required. An expression that returns a reference to the ExternalApplication object.
Security Level
3: Can be accessed only by fully trusted forms.
Remarks
If you use the Close method of the ExternalApplication object before using the Quit method, data that has been changed in the form will not
be saved, nor will users be prompted to save it. However, if you do not use the Close method but only use the Quit method, users will be
prompted to save the form before quitting the InfoPath application.
Example
In the following example, which is written in the Visual Basic for Applications (VBA) programming language, the Quit method of the
ExternalApplication object is used to quit the InfoPath application:
Public Sub AutomateInfoPathForm()
Dim objIP As Object
'Create a reference to the ExternalApplication object.
Set objIP = CreateObject("InfoPath.ExternalApplication")
'Open an InfoPath form.
objIP.Open ("C:\My Forms\Form1.xml")
MsgBox ("The InfoPath form has been opened.")
'Close the InfoPath form.
objIP.Close ("C:\My Forms\Form1.xml")
MsgBox ("The InfoPath form has been closed.")
'Quit the InfoPath application.
objIP.Quit
MsgBox ("The InfoPath application has been closed.")
Set objIP = Nothing
End Sub
Best Regards,
Sheetal D
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: "Andrew Watt [MVP - InfoPath]" <
[email protected]>
Subject: Re: close form in infopath
Date: Mon, 26 Sep 2005 12:15:40 +0100
Message-ID: <
[email protected]>
References: <u#
[email protected]>
X-Newsreader: Forte Free Agent 2.0/32.646
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: microsoft.public.infopath
NNTP-Posting-Host: ACCA4BE3.ipt.aol.com 172.202.75.227
Lines: 1
Path: TK2MSFTNGXA01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12.phx.gbl
Xref: TK2MSFTNGXA01.phx.gbl microsoft.public.infopath:17189
X-Tomcat-NG: microsoft.public.infopath
In JScript, how is it possible to automatically close the form, or better
yet, how can I close the InfoPath application?
Thanks
Have a look at the product documentation on the Close() and Quit()
methods.
Andrew Watt
MVP - InfoPath