Window2.Close(Boolean) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Closes the window that is represented by the WindowObject object.
public void Close (bool fForce = false);
abstract member Close : bool -> unit
Public Sub Close (Optional fForce As Boolean = false)
Parameters
- fForce
- Boolean
Determines whether open documents will be saved. The default value is false.
Implements
Examples
In the following example, the Close method of the Window object is used to close the currently active window, forcing a save if changes in the form have occurred:
thisApplication.ActiveWindow.<span class="label">Close</span>(false);
Remarks
The Close method will close the associated window and the forms that it contains. If the bForce
parameter is set to true, all forms will be closed without saving, even if they contain changes since they were last saved. If set to false, users will be prompted to save their changes.
The Close method can be used only with the editing window types; if used with a designing window type, it will return an error. In addition, the Close method can only be used with the OnSubmitRequest and OnClick event handlers. If used with any other type of event handler, it will return an error.
Note: If the window being closed is the only window open in Microsoft Office InfoPath 2003, the InfoPath application will also be closed.