Ask Your Question
0

Use the event of an assigned macro

asked 2019-11-19 03:52:04 +0100

Alectrona gravatar image

updated 2019-11-20 05:19:33 +0100

In LibreOffice 6.2.8, I assign the macro FrmExit to my Frame on the event "Non-alphanumeric input"

But how do I pass this event as a parameter in my sub ?

Sub FrmExit(oEvent)

MsgBox(oEvent.KeyCode)

End Sub

This says the object oEvent is undefined.

edit : im using a frame, not a textbox. sorry for the confusion

edit retag flag offensive close merge delete

Comments

Hello,

Couple of items that are uncertain. What "Text Box" are you concerned with - form control or graphical Draw object? Also where did you find "Non-alphanumeric input" event? Don't see this anywhere for these objects.

Ratslinger gravatar imageRatslinger ( 2019-11-19 19:45:48 +0100 )edit

form control or graphical Draw object?

Not sure what is the difference. I create a textbox by clicking insert > textbox and then typing text inside. Then anchors it as a character and save it as an autotext.

Also where did you find "Non-alphanumeric input" event? Don't see this anywhere for these object

https://imgur.com/a/ep4WRVP

Alectrona gravatar imageAlectrona ( 2019-11-20 05:05:45 +0100 )edit

I use a frame, not a textbox to be more precise.

Alectrona gravatar imageAlectrona ( 2019-11-20 05:10:21 +0100 )edit

How to show this dialog box?, ok, I see, it's a frame, not a textbox

mauricio gravatar imagemauricio ( 2019-11-20 05:14:47 +0100 )edit

Right click on a frame, properties > macro tab edit : yes sorry, i thought textboxes had the same features.

Alectrona gravatar imageAlectrona ( 2019-11-20 05:15:46 +0100 )edit

@Alectrona,

Yes, being precise is important. There is a difference between a text box control and the text box graphical object (Insert->Text Box) and even more so when it is really a Frame. The text boxes noted do not have any such event as you used.

Ratslinger gravatar imageRatslinger ( 2019-11-20 05:34:43 +0100 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-11-20 05:23:23 +0100

mauricio gravatar image

This event required two arguments... In Python is:

def input_frame(name, code):
    if code == 1282:
        app.msgbox('Press TAB')
    return

In Basic, I not test

Sub input_frame(name, code)

End Sub
edit flag offensive delete link more

Comments

Works perfectly! Thanks alot.

Alectrona gravatar imageAlectrona ( 2019-11-20 05:29:16 +0100 )edit

@Alectrona,

As you have been helped, please help others to know the question has been answered by clicking on the ✔ in upper left area of answer which satisfied the question.

Ratslinger gravatar imageRatslinger ( 2019-11-20 06:04:00 +0100 )edit

mb i probably clicked twice

Alectrona gravatar imageAlectrona ( 2019-11-20 17:57:30 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2019-11-19 03:52:04 +0100

Seen: 26 times

Last updated: Nov 20