Ask Your Question
0

Button in Macro to Print a Sheet

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

ago_med gravatar image

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

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
0

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

chin gravatar image

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

mark_t gravatar image

.

Sub PrintDoc

Dim Document As object

Dim Dispatcher As Object

Document = ThisComponent.CurrentController.Frame

Dispatcher = createUNOService("com.sun.star.frame.DispatchHelper")

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

Comments

Edit to put the code in a code block.

mark_t gravatar imagemark_t ( 2016-10-18 19:45:36 +0100 )edit
0

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

ago_med gravatar image

Thank You so much!!!

It worked ....

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

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

Seen: 1,081 times

Last updated: Oct 24 '16