_XDocument4.CloseDocument Method
Closes the form.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)
Syntax
'Declaration
Sub CloseDocument
'Usage
Dim instance As _XDocument4
instance.CloseDocument()
void CloseDocument()
Implements
Remarks
Calling the CloseDocument method is equivalent to calling the Close method of the XDocuments3 collection.
Because the CloseDocument method is new to Microsoft InfoPath 2010, you must cast the XDocument object to the _XDocument4 type to access this method. For more information, see How to: Use Microsoft.Office.Interop.InfoPath.SemiTrust Members That Are Not Compatible with InfoPath 2003.
Important
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
Examples
In the following example, the CloseDocument method of the XDocument object is used to close the current form.
_XDocument3 thisDoc = (_XDocument3)thisXDocument;
thisDoc.CloseDocument();
Dim thisDoc As _XDocument4 = DirectCast(_
thisXDocument, _XDocument4)
thisDoc.CloseDocument()