Hello.
I’m trying to make a macro to directly print a portion of a sheet when I click on it. The basic code below sort of works:
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())
The only problem is that whenever I press a button to call this macro, the print procedure starts as expected but also still goes through the “Print preview” menu every time. I’d like to skip that part, and go straight to a print without any further interaction/confirmation/user input required.
So, how can I adjust the code so that it will skip that part, and print without further confirmation?