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.)
AOO 3.4 or 4.0 on MS Windows XP ( before 2013-08-03) or Windows 7
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.