ControlExecuteClosing (Function) In french: ChampExécuteFermeture Runs the closing WLanguage event of an office control and displays its confirmation dialog if necessary.
// Click the VALIDATE button IF NOT ControlExecuteClosing(PSHEET_Spreadsheet) THEN RETURN END Close()
Syntax
<Result> = ControlExecuteClosing(<Office control>)
<Result>: Boolean - If the closing WLanguage event of the control returns a value (True or False), <Result> corresponds to this value.
- If the closing WLanguage event of the control returns no value:
- if the Modified property of the control is set to True, a confirmation dialog is displayed: <Result> is set to False if the user asks not to close the document, True otherwise.
- if the Modified property of the control is set to False, the function returns True.
<Office control>: Control name Name of office control to use. This control can correspond to: - a Spreadsheet control,
- a Word Processing control,
- an Image Editor control,
- a PDF Reader control.
Remarks - This function is automatically called by the ribbon of office controls (Spreadsheet, Word Processing, Image Editor or PDF Reader controls) on the following user actions:
- New.
- Open.
- Drag and Drop a document to the control.
- This function performs the following operations:
- Running the event "Before closing the document".
- If this event returns a value (True or False), the function stops and returns this value.
- If this event does not return a value:
- if Modified on the control is set to True, the function displays a confirmation dialog to the user and it returns False if the user asks not to close the document.
- if the Modified property of the control is set to False, the function returns True.
- This function can be called for example when closing a window or before a new content is assigned to the control.
- The following code allows you to display the confirmation dialog only:
bCloseOK = AAFExecute(PSHEET_Spreadsheet, aafClosingDialog)
- To run only the closing WLanguage event of the document, use the following code:
ExecuteProcess(PSHEET_Spreadsheet, trtBeforeClosingDocument)
This page is also available for…
|
|
|
|