Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.

OLE.EditSelection properyt

I have tried this, selecting text in the current cell, but the result returns 0:0
Please can you confirm this is working for you.
Selection=Get_Property(OLE_DESCTABLE,"OLE.EditSelection") I assume there is no need for any reference to the SelPos being the currently active edited cell.

Thanks

Colin

Comments

  • Colin,

    What event are you checking this property in? It does work for me in the BeforeUpdate event.
  • If you are checking this property during the vent of, say, a button click, then the table loses focus and the edit mode is closed. This would cause the property to return 0:0. In other words, this property only returns information if a cell is in edit mode.
  • That would be it then.
    I am doing the function within a click event (calling a form).
    The idea is that the form that is called allows a selection from a list, which the aim is to replace the selected text within the edittable cell with that text.

    For example "Spec ? in drawing ?" where the ? characters would be selected, and say a drawing number is added.

    I will see about doing this in a different way, such as on lostfocus I can get the selected text positions, store this somewhere and then use it in the called routine.
  • Then you should use the SRP Button Control and set it to a style that does not alter focus. The downside is that users can't tab to such a button, but it simplifies this issue significantly.
Sign In or Register to comment.