Hi Moisés,

------------------------------------------------
sub Main
ThisComponent.currentController.select(ThisComponent.Sheets(3))
printSelection
ThisComponent.currentController.select(ThisComponent.Sheets(4))
printSelection   end sub


sub printSelection
xFrame   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args(0) as new com.sun.star.beans.PropertyValue
args(0).Name = "Selection"
args(0).Value = true
dispatcher.executeDispatch(xFrame, ".uno:Print", "", 0, args())
end sub
------------------------------------------------

I tried this, but it prints all the pages not the selection :(

That is strange, since it worked for me ... well I removed some args that I though would be superfluous ... you could give the following a try

---------------------
sub printSelection
xFrame   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Copies"
args1(0).Value = 1
args1(1).Name = "Selection"
args1(1).Value = true
args1(2).Name = "Collate"
args1(2).Value = false

dispatcher.executeDispatch(xFrame, ".uno:Print", "", 0, args1())
end sub
---------------------

Hope that helps

Regards

Stephan

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to