Partager via


_ExternalApplication.Close - Méthode

Ferme le formulaire Microsoft InfoPath spécifié.

Espace de noms :  Microsoft.Office.Interop.InfoPath
Assembly :  Microsoft.Office.Interop.InfoPath (dans Microsoft.Office.Interop.InfoPath.dll)

Syntaxe

'Déclaration
Sub Close ( _
    bstrDocumentURI As String _
)
'Utilisation
Dim instance As _ExternalApplication
Dim bstrDocumentURI As String

instance.Close(bstrDocumentURI)
void Close(
    string bstrDocumentURI
)

Paramètres

  • bstrDocumentURI
    Type : System.String

    La valeur de cette chaîne spécifie l'URI (Uniform Resource Identifier) d'un formulaire.

Remarques

La méthode Close ferme le formulaire actuellement ouvert sans quitter l'application InfoPath. Lorsque vous utilisez la méthode Close, le formulaire est fermé de manière inconditionnelle, ce qui signifie que les modifications apportées aux données ne sont pas enregistrées.

Exemples

Dans l'exemple suivant, écrit en c# langage de programmation, la méthode Close de l'objet ExternalApplication est utilisée pour fermer le formulaire actuellement ouvert :

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();
}

Notes

L'exemple ci-dessus suppose que l'espace de noms Microsoft.Office.Interop.InfoPath est utilisé et que la bibliothèque de type Microsoft InfoPath 2.0 est référencée.

Voir aussi

Référence

_ExternalApplication interface

_ExternalApplication - Membres

Microsoft.Office.Interop.InfoPath - Espace de noms