How do I select text in a dialog box TextField (or NumericField) in a macro?

As in the picture attached:
Снимок экрана от 2022-04-09 10-44-38

The control is already in focus.

Do you want to select (highlight) only, or you want to get the text?
Can you upload an ODF type sample file with your macro here?

To select (highlight) only. I can’t find a proper method.
I don’t like the way the spin buttons are displayed in the numeric field. Numbers from 0 to 9 are entered. If the input is incorrect, you must erase the value or double click to highlight it.

In general, this is not a problem. How to highlight? It’s a learning question.

Try setSelection.

1 Like

Great!

    Dim sel As New com.sun.star.awt.Selection
    sel.Min = 0: sel.Max = 1
    oDlg.getControl("SomeNumericField").setSelection(sel)