Newly created macro will not run. [closed]

asked 2014-05-23 18:23:52 +0200

emann gravatar image

updated 2014-05-23 23:10:48 +0200

karolus gravatar image

I am trying to create a writer macro that will print only the currently selected page. I recorded the commands File, Print, Pages (current page is selected), OK , and saved the macro as "PCP (print current Page) In My Macros, Standard, new module PCP. The commands I entered do indeed print the current page but nothing happens when I run the macro. This is exactly how I created the same macro in Word. Any suggestions as to what I am doing wrong? I know a macro cannot open a new window - would the print window be considered a new window and this is why it will not work? Below is a past of what LibreOffice created when I did this. Any help would be appreciated! Thank you!

sub PCP

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
edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by Alex Kemp
close date 2016-02-23 19:47:07.899427