Assigning a Macro to a button

Creating a macro - Writing a Script - Using the API (OpenOffice Basic, Python, BeanShell, JavaScript)
Post Reply
sharp_shooter
Posts: 1
Joined: Sun Jun 08, 2014 9:35 pm

Assigning a Macro to a button

Post by sharp_shooter »

Hi
I'm fairly new to Open Office
I'm having trouble assigning Macro's that have been written in Open Office to buttons.
The macros work fine when run, but the instructions in the help seem to be as clear as mud regarding assigning to buttons.
Any help gratefully received.

sharp_shooter
OpenOffice 4.0.1 windows 7 Home Premium
FJCC
Moderator
Posts: 9621
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Assigning a Macro to a button

Post by FJCC »

I assume you have already drawn the button using the tool bar accessible from View -> Toolbars -> Form Controls. Use that tool bar to put the button in Design Mode. You do that with the icon that represents a drawing triangle, ruler and pencil, which is the second icon on the tool bar. Now right click on the button and select Control. On the Events tab click the little button on the far right of the item Mouse Button Released and then click the Macro button. After a few moments a dialog will appear where you can navigate to the location of the macro. Navigate through the Libraries and Modules and choose the procedure you want to run with the button. Click OK to get out of dialogs. Now use the Form Control tool bar to get out of Design Mode using the same icon as before. Clicking the button should now trigger the macro.
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