IOleDocumentBoxEventParams.Param

Syntax

Param(Index: Integer): Variant;

Parameters

Index. Index of the parameter of event of the object loaded to OleDocumentBox.

Description

The Param property returns parameter of event of the object loaded to OleDocumentBox.

Comments

Methods of the Variant class are used to work with parameters. Learn the appropriate class of object using third-party applications to get information about parameters of the particular event.

Example

Executing the example requires a form with the Button1 button and the OleDocumentBox component. A Microsoft Excel sheet is loaded to the OleDocumentBox component.

Sub OleDocumentBox1OnOleDocumentEvent(Sender: IOleDocumentBox; Args: IOleDocumentBoxEventArgs);
Var
    Sheet, Range: Variant;
    Row, Column: Integer;
    s: String;
Begin
    
If Args.DispId = 1559 Then
        Sheet := Args.Params.Param(
0);
        s := Sheet.GetProperty(
"Name"As String;
        Range := Args.Params.Param(
1);
        Column := Range.GetProperty(
"Column"As Integer;
        Row := Range.GetProperty(
"Row"As Integer;
        Args.Params.Param(
2) := True;
    
End If;
End Sub OleDocumentBox1OnOleDocumentEvent;

The double-click of the mouse button on the sheet cell is registered during execution of the OnOleDocumentEvent event. This event has the 1559 identifier, three parameters are passed in it: 1) The sheet, on which the event is generated. 2) The cell, which is double-clicked. This parameter is a range and contains multiple parameters. The GetProperty method is used for its analysis. 3) The logical parameter that determines whether the cell edit mode should be enabled. The "s" variable contains the name of the sheet, the Row and Column variables contain a number of row and a number of column, respectively, which was double-clicked, and it is prohibited to enable edit mode.

See also:

IOleDocumentBoxEventParams