Quit Method (Application Object)

Microsoft Office InfoPath

Quits the Microsoft Office InfoPath 2003 application.

expression.Quit([ByVal bForce As Boolean = False])

expression    Required. An expression that returns a reference to the Application object.

bForce Optional Boolean. Default value is False. Determines whether open forms will be saved during the quit operation. If set to False, all forms will be closed without saving, even if the data in the forms has been changed. If set to True, the user will be prompted to save the forms.

Security Level

3: Can be accessed only by fully trusted forms.

Remarks

If the Quit method is used in a form that is not fully trusted, the method will return a "permission denied" error.

Example

In the following example, the Quit method of the Application object is used to quit InfoPath without saving any of the currently open forms:

Application.Quit(false);