The starting and end positions of the currently edited cell's selected text.

Usage

Set_Property(OLECtrlEntID, "OLE.EditSelection", Array)

Values

Array has the following structure:

PosNameTypeDescriptionDefault
<1>StartIntegerThe selection start position1
<2>EndIntegerThe selection end position1

Remarks

The EditSelection property allows you to programmatically modify the selected text in the currently edited cell.

If Start is 0, then End is ignored and the selection is removed.

If End is 0, then all text from Start to the end is selection.

If both Start and End are greater than 0, then the text is selected from Start to End.

Unlike OI's SELECTION property, the EditSelection property is in the format Start:@FM:End whereas OI's SELECTION property is in the format Start:@FM:Length.

Example

// Select all the text of the currently edited cell 
Set_Property(@Window:".OLE_EDITTABLE", "OLE.EditSelection", 1:@FM:0) 

// Remove the selections from the currently edited cell 
Set_Property(@Window:".OLE_EDITTABLE", "OLE.EditSelection", 0:@FM:1) 

// Select only the first 3 characters of the currently edited cell 
Set_Property(@Window:".OLE_EDITTABLE", "OLE.EditSelection", 1:@FM:3) 

// Select from the 3rd character to the end 
Set_Property(@Window:".OLE_EDITTABLE", "OLE.EditSelection", 3:@FM:0) 

// Get the selection of the currently edited cell 
Selection = Get_Property(@Window:".OLE_EDITTABLE", "OLE.EditSelection")

See Also

EditText

  • No labels