[Solved] How to attach a macro to a push button

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
sirwolf2007
Posts: 32
Joined: Fri Jun 05, 2009 3:56 pm

[Solved] How to attach a macro to a push button

Post by sirwolf2007 »

i have the macros done and the button setup but i cant figure out how to attch the macro to the button from the design modesirwolf2007
Last edited by sirwolf2007 on Wed Jun 10, 2009 2:58 pm, edited 1 time in total.
OOo 2.3.X on Ms Windows XP
FJCC
Moderator
Posts: 9278
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: How to attach a macro to a push button

Post by FJCC »

Right click on the button, choose Controls and then choose the Events tab of the dialog that appears. Choose an event type, say Mouse Button Released, and click on the associated small button with three dots on the right edge of the dialog. This will bring up a new dialog. Click the Macro button at the top right and navigate to the macro you want. After choosing the macro, click Accept to get back to the first dialog. This will now show the macro next to the chosen event. You can close this dialog and switch the button out of design mode. It will now activate the macro when you click and release.

(I don't have my interface in English at the moment, so the exact labels of dialogs and buttons may not be right in my description.)
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
Post Reply