Edit

Share via


_XDocument3.CloseDocument Method

Definition

Closes the form.

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

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 _XDocument3 = DirectCast(_
   thisXDocument, _XDocument3)
thisDoc.CloseDocument()

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 _XDocument3 = DirectCast(_
   thisXDocument, _XDocument3)
thisDoc.CloseDocument()

Remarks

Calling the CloseDocument method is equivalent to calling the Close(Object) method of the XDocuments2 collection.

Because the CloseDocument method is new to Microsoft InfoPath, you must cast the XDocument object to the _XDocument3 type to access this method. For more information, see How to: Use Object Model 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.

Applies to