OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

print first page to tray 2 and next pages to tray 1

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
pbd4499
General User
General User


Joined: 04 Jun 2007
Posts: 23

PostPosted: Tue Nov 20, 2007 6:12 am    Post subject: print first page to tray 2 and next pages to tray 1 Reply with quote

Why is this code not working? It's ceated with the macro-recorder:

sub PrintFrstPage()
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Copies"
args1(0).Value = 1
args1(1).Name = "RangeText"
args1(1).Value = "1"
args1(2).Name = "Collate"
args1(2).Value = false

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


sub PrintNextPages()
rem ----------------------------------------------------------------------
rem define variables
dim document as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(2) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Copies"
args1(0).Value = 1
args1(1).Name = "RangeText"
args1(1).Value = "2-*"
args1(2).Name = "Collate"
args1(2).Value = false

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

I don't think the Tray is detected by the MacroRecorder.

thanks in advance,

pamhkl


Last edited by pbd4499 on Wed Nov 21, 2007 12:58 am; edited 1 time in total
Back to top
View user's profile Send private message
foxcole
Super User
Super User


Joined: 19 Jan 2006
Posts: 2771
Location: Minneapolis, Minnesota

PostPosted: Tue Nov 20, 2007 9:18 am    Post subject: Reply with quote

For help with code, you should ask in the Macros and API forum.

In general, the printer tray is controlled through the page style. If you open a page style for edit and go to the Page tab, you'll find a setting for Paper Tray (which defaults to "From printer settings").

So you need two page styles, one for the first page to go to one tray and the second style to go to the other tray.
_________________
Cheers!
---Fox

WinXP Pro SP2, OOo Portable 2.3.1, OOo local 2.4 RC4
New OpenOffice forum: http://user.services.openoffice.org/en/forum/
Manuals: http://documentation.openoffice.org/manuals/index.html
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group