Partager via


_ExternalApplication.Quit Méthode

Définition

Quitte l’application Microsoft InfoPath.

public:
 void Quit();
public void Quit ();
abstract member Quit : unit -> unit
Public Sub Quit ()

Exemples

Dans l’exemple suivant, écrit en langage de programmation C#, la méthode Quit de l’objet ExternalApplication est utilisée pour fermer 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.<span class="label">Quit</span>();
}

Remarque : L’exemple ci-dessus suppose que l’espace Microsoft.Office.Interop.InfoPath de noms est utilisé et que la bibliothèque de types Microsoft InfoPath 3.0 est référencée.

Dans l’exemple suivant, écrit en langage de programmation C#, la méthode Quit de l’objet ExternalApplication est utilisée pour fermer 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.<span class="label">Quit</span>();
}

Remarque : L’exemple ci-dessus suppose que l’espace Microsoft.Office.Interop.InfoPath de noms est utilisé et que la bibliothèque de types Microsoft InfoPath 3.0 est référencée.

Remarques

Si vous utilisez la Close(String) méthode avant d’utiliser la méthode Quit , les données qui ont été modifiées dans le formulaire ne seront pas enregistrées et les utilisateurs ne seront pas invités à les enregistrer. En revanche, si vous n'utilisez pas la méthode Close, mais uniquement la méthode Quit, les utilisateurs seront invités à enregistrer leur formulaire avant de quitter l'application InfoPath.

S’applique à