Ask Your Question

Button in Macro to Print a Sheet

asked 2016-10-18 02:00:10 +0200

ago_med gravatar image

updated 2016-10-18 19:46:44 +0200

mark_t gravatar image

Good Night..

I need a macro code to associate a button in order to Print a sheet, in Libreoffice Calc...

Can someone help me ?

Thanks a lot!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-10-24 20:44:13 +0200

ago_med gravatar image

Thank You so much!!!

It worked ....

edit flag offensive delete link more

answered 2016-10-18 19:31:28 +0200

chin gravatar image

updated 2016-10-18 19:44:51 +0200

mark_t gravatar image


Sub PrintDoc

Dim Document As object

Dim Dispatcher As Object

Document = ThisComponent.CurrentController.Frame

Dispatcher = createUNOService("")

Dispatcher.executeDispatch(Document,".uno:Print", "", 0, Array())

End sub

On the spreadsheet Menu: View...ToolBars...FormControl. Create the button. Open the Button. In Design mode find the Events menu to enable connection with the above Macros. This should be in "Mouse button pressed" list to enable its action. Hope this helps.

edit flag offensive delete link more


Edit to put the code in a code block.

mark_t gravatar imagemark_t ( 2016-10-18 19:45:36 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2016-10-18 02:00:10 +0200

Seen: 2,210 times

Last updated: Oct 24 '16