_ExternalApplication.Open-Methode
Öffnet das angegebene Microsoft Office InfoPath 2007-Formular.
Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)
Syntax
'Declaration
<DispIdAttribute(5)> _
Sub Open ( _
<InAttribute> bstrDocumentURI As String, _
<InAttribute> <OptionalAttribute> Optional dwBehavior As Integer = 1 _
)
'Usage
Dim instance As _ExternalApplication
Dim bstrDocumentURI As String
Dim dwBehavior As Integer
instance.Open(bstrDocumentURI, dwBehavior)
[DispIdAttribute(5)]
void Open (
[InAttribute] string bstrDocumentURI,
[OptionalAttribute] [InAttribute] int dwBehavior
)
Parameter
- bstrDocumentURI
Der Zeichenfolgenwert, der den URI (Uniform Resource Identifier) eines Formulars angibt.
- dwBehavior
Der Standardwert ist 1. Gibt an, wie das Formular geöffnet werden soll. Die Werte basieren auf der XdDocumentVersionMode- Enumeration.
Hinweise
Die Open-Methode kann nur zum Öffnen eines Formulars verwendet werden. Sie kann nicht verwendet werden, um eine Formularvorlage zu öffnen. Um ein Formular mithilfe einer Formularvorlage zu erstellen, verwenden Sie die NewFromSolution-Methode. Um ein Formular basierend auf einem vorhandenen Formular zu erstellen, verwenden Sie die New-Methode.
Beispiel
Im folgenden in der Programmiersprache C# geschriebenen Beispiel dient die Open-Methode des ExternalApplication-Objekts zum Öffnen eines Formulars im Dateisystem:
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();
}
![]() |
---|
Beim vorstehenden Beispiel wird davon ausgegangen, dass der Microsoft.Office.Interop.InfoPath-Namespace verwendet und auf die Microsoft InfoPath 2.0-Typbibliothek verwiesen wird. |
Siehe auch
Referenz
_ExternalApplication-Schnittstelle
_ExternalApplication-Member
Microsoft.Office.Interop.InfoPath-Namespace