How do I get the name of the current TextField in macro when i'm using libreoffice Form?

Hello. I’m new in basic language for macros in libreoffice and I’m having a doubt. Has it a way to get the name of the current textfield that i’m in? For exemple: I click in one of the textField and I want his name to put it as a value, but without knowing the textField name.

Hello,
Do not quite understand the intent. You are using a form with a Text Box control or is it a text field used for such as mail merge? Are you expecting the mouse click to trigger the macro? Either way you eventually needy the name for the macro to complete the task.

1 Like

But it has a way to get the name of the current active Text box? The thing circled in red in the image. But, any way, thanks.
Captura de tela 2022-12-01 170036

@RedColl
Still unclear as to how this is actually used but it can be done with a Text Box control. A simple macro attached to a mouse click or release:

Sub value_entry(tbEvent)
  tbEvent.Source.Model.Text = "A Name Appears"
End Sub

Sample → NameToTextBox.odt (11.2 KB)
.
Just mouse click in the text box field.
.
Edit:
.
If placed in this Sub with tbEvent, you can get the name of the control:

ctl_name = tbEvent.Source.Model.Name