Share via


_ExternalApplication.Quit method

Quits the Microsoft InfoPath application.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
Sub Quit
'Usage
Dim instance As _ExternalApplication

instance.Quit()
void Quit()

Remarks

If you use the Close method 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.

Examples

In the following example, which is written in the C# programming language, the Quit method of the ExternalApplication object is used to close InfoPath:

private void AutomateInfoPathForm()
{
 ExternalApplication infoPath = new ExternalApplicationClass();
 // Open an InfoPath form.
 infoPath.Open(@"C:\My Forms\Form1.xml", 1);

 // Close the InfoPath form.
 infoPath.Close(@"C:\My Forms\Form1.xml");

 // Quit the InfoPath application.
 infoPath.Quit();
}

Note

The above example assumes that the Microsoft.Office.Interop.InfoPath namespace is being used and that the Microsoft InfoPath 3.0 Type Library is referenced.

See also

Reference

_ExternalApplication interface

_ExternalApplication members

Microsoft.Office.Interop.InfoPath namespace