Print First Two pages in First Page Tray & remang. in other pages

I use one tray for Headed Paper and another for plain paper.
Using macro i print first page of the document to the headed paper and 
remaining pages in plain paper tray correctly.

Now to be more eco-friendly, to avoid wastage of papers, i need to print the 
second page of the document to the headed paper back side.

So ideally i need to Print First Two pages in First Page Tray & remaining 
pages in other pages tray (which is already duplexed).

Need to if this is possible. 

Code
--declare
Dim sPrinterName$
Dim sPortName$
Dim nFirstPageTray
Dim nOtherPagesTray

-- assignment 
sPrinterName$ = 'assign print name
sPortName$ = 'assign port name
nFirstPageTray = ' assign "First Page Tray"
nOtherPagesTray = ' assign "Other Pages Tray"

--Set print details
WordBasic.FilePrintSetup Printer:=sPrinterName$ + " on " + sPortName$, 
DoNotSetAsSysDefault:=1

--Set the trays
WordBasic.FilePageSetup applypropsto:=4, FirstPage:=nFirstPageTray, 
OtherPages:=nOtherPagesTray

--Print the ducment
WordBasic.FilePrint Background:=1

Thanks
Sivakumar

0
Utf
6/4/2010 9:36:40 AM
word.vba.general 1023 articles. 1 followers. Follow

1 Replies
2654 Views

Similar Articles

[PageSpeed] 5

See your post in the pagelayout group.
Please do not multi-post

-- 
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"Sivakumar" <Sivakumar@discussions.microsoft.com> wrote in message 
news:06C5DC2B-B8C8-46A4-9982-446AC0488271@microsoft.com...
>I use one tray for Headed Paper and another for plain paper.
> Using macro i print first page of the document to the headed paper and
> remaining pages in plain paper tray correctly.
>
> Now to be more eco-friendly, to avoid wastage of papers, i need to print 
> the
> second page of the document to the headed paper back side.
>
> So ideally i need to Print First Two pages in First Page Tray & remaining
> pages in other pages tray (which is already duplexed).
>
> Need to if this is possible.
>
> Code
> --declare
> Dim sPrinterName$
> Dim sPortName$
> Dim nFirstPageTray
> Dim nOtherPagesTray
>
> -- assignment
> sPrinterName$ = 'assign print name
> sPortName$ = 'assign port name
> nFirstPageTray = ' assign "First Page Tray"
> nOtherPagesTray = ' assign "Other Pages Tray"
>
> --Set print details
> WordBasic.FilePrintSetup Printer:=sPrinterName$ + " on " + sPortName$,
> DoNotSetAsSysDefault:=1
>
> --Set the trays
> WordBasic.FilePageSetup applypropsto:=4, FirstPage:=nFirstPageTray,
> OtherPages:=nOtherPagesTray
>
> --Print the ducment
> WordBasic.FilePrint Background:=1
>
> Thanks
> Sivakumar
> 


0
Graham
6/4/2010 11:10:52 AM
Reply:

Similar Artilces:

report new page for each alpha
I have a report that produces an alphabetic directory, with the entries for each new letter (A, B, C,) starting on a new page. I have one letter, U, which has only one entry, and for some reason it is coming out on the last T page (it is the only single-entry letter which happens to fall behind a "full" page, where there isn't room on the previous page - but there are plenty of other "short" pages where it correctly does a page break before a letter. Any reason a particular letter (and it's not the only single-entry letter) might not break pages proper...

2-Sided Printing: HP Photosmart D7300 Series. Right edge of image clipped off, won't allow manual feed #2
We are wasting tons of paper trying to print a "booklet" 2 sided. Printer: HP Photosmart D7300 Paper 8.5x11 Booklet 5.5 x 8.5 Printer set at landscape Ran 2-side configuration wizard. Did all paper feeds (numbers and circles) When attempting to print, right side is clipped off No prompts appear to turn paper over. When printer is set to BORDERLESS, the full right side of image appears, but left side of page is trimmed off. "fit image to paper" option vanishes. Is there a way to do this? Thank you. How many pages? Is the print preview correct? I only know how I...

system tray new mail icon gone :(
Before i used to have an icon pop up in my system tray when i received a new mail. I accidently hid it one time and it no longer comes back. How can i get it back. I run Outlook Xp on a Win XP pro machine. Thanks in advance.. --minnoce944 Check Tools, Options, Email Options, Advanced Email Options. MAke sure the checkbox for "show an envelope in the notification area" is checked. If it is, right click on the Windows taskbar. Choose Properties, then customize. Your icon might have just been set to always hide. If so, you can change it to always show. -- Patricia Cardoza Outlook...

Two messages at no data in a report
I have a form with a Click-Buttom for opening a report. In the design mode of the report I have used "At no data" and there included a Messega Box saying "Sorry-there is no data in this report". When having no data i the report and clicking on my buttom in the form I will hav 2 messages. The first one is from my message box "Sorry ...." The second one is from the error handling for the buttom saying "Instructio Open report cancelled" (Translated from Swedish "Instruktionen PoenReport avbröts). A part of the error code for the buttom is...

Crazy printing ...
I'm using XP (SP2) and XP Office. This includes Publisher 2003. I'm using a Canon S200 printer. This was previously attached to another computer running Win98SE. There were no printing problems. I installed it to the XP system using the Canon CD. Now however it goes crazy when I use Publisher. I'm trying to print a booklet, two A5 pages on a single A4 sheet. Everything pans out in Print Preview. When I print however, all sorts of crazy things happen. It shrinks the text to nothing. It prints portrait instead of landscape. And more. Whatever I tell it to do, it ignores. As far a...

Clip Art won't print #2
My operating system is Windows Vista, I have an HP Photosmart 8450 printer and when using Publisher 2007, none of the clip art will print. Actually, no clip art will print in any of the Office 2007 programs, but Publisher is the one that I was using when I discovered this. Has anyone else had this problem? Any suggestions on how to fix it? Thanks. Are you using updated drivers? -- JoAnn Paules Microsoft MVP - Publisher How to ask a question http://support.microsoft.com/kb/555375 "Ms. CCC-SLP" <Ms. CCC-SLP@discussions.microsoft.com> wrote in message news:577191CD...

Page not found error when opening business portal
Hi We're trying to install Invoice Approvals and Accruals 8.0, sharepoint services sp2 and Business Portal 2.5 Feature Pack to work with Great Plains 8.0 We can install Sharepoint services and Invoice Approvals and Accruals ok and they work fine However, when we install Business Portal and browse to http://servername/sites/businessportal/ We receive a "page not found" error screen We've tried several things but nothing seems to work Sharepoint services is installed in server farm mode and has been configured correctly (as far as I can tell) Any help would be great...

Page Setup #4
I set up a document for dimensions to be 8x11, save it and close it. The next day I open that same document and find that it has gone back to the default settings of 8.5x11? Would anyone know how I can avoid this risky behavior? -- Chips and Charlie Is your stock actually 8 inches? If it is you must setup your printer for 8 X 11 as well as your page setup. -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "Chips and Charlie" <ChipsandCharlie@discussions.microsoft.com> wrote in message news:E619DDBA-9FF3-4E26-8D3...

DNS Question
Hello All, I am working with a customer that has 2 Small Biz servers in the same office. These are on 2 domains, but the same subnet. I am having trouble getting mail to route between the 2 domains. Each is Small Biz server 2003. Domain A has a public IP of 72.151.19.122 and an internal IP of 192.168.200.78. Domain B has a public IP of 72.151.19.123 and an internal IP of 192.168.200.250. We are using a Netgear firewall and inbound and outbound mail between each of these domains and the rest of the world works fine. They just can't seem to talk to each other. I would think this woul...

enter-key works with two inputboxes but not with olny one.
Hi, There is a form with two inputboxes and a submit button.The focus is on the first inputbox. When the user presses the enter-key without having entered some text, the javascript message "wrong text" appears. This works. But if i remove the second inputbox, leaving only the first inputbox and the submit button, pressing the enter-key without any text does not show the javascript message. Nothing happens. The focus remains in the inputbox. You can see the page is postbacked, but that's all. Why does it work with two inputboxes and not with one? And how to fix...

Load Last Page
I know you can "load first page" In CRM. Is there a way to Load LAST page instead of having to load each page? thank you The easiest way is changing the sort order (click on the appropriate column header). This then displays the "last" page. It's not exactly the same though. -- Michael H�hne, Microsoft Dynamics CRM MVP CRM Blog on http://www.stunnware.com ---------------------------------------------------------- "Bernardina" <dl@discussions.microsoft.com> schrieb im Newsbeitrag news:6243B5ED-9377-49CD-8CB3-9E84F1BAE5FA@microsoft.com... >I ...

Saving one page -- as Template?
Therre are several pages in a 40-page booklet I want to save to use in future editions. Is there a method to save these pages for re-us? Or must I save the entire publication as a Template? Can I copy single pages and paste in another .pub file? Save the entire document and delete out the pages you don't want. -- JoAnn Paules MVP Microsoft [Publisher] Tech Editor for "Microsoft Publisher 2007 For Dummies" "cuig" <cuig@discussions.microsoft.com> wrote in message news:16052168-6085-43D0-AD8B-2CF4839933FC@microsoft.com... > Therre are several pages in...

4 page publication onto a website
I am trying to put a 4 page publication on to the website so that it can be opened by people who don't have publisher. I managed to do it last month but for can't remember how I did it. When I convert it to a web page it only shows the first page of the publication. Last months issue, when I checked back is a mht.doc but I don't know how I converted the publisher document to this. Can anyone help please? How about converting the Publisher file to a PDF. This way more visitors will have the capability to view it. Many folks here recommend the free primopdf which can be ...

printing #2
i am trying to print a flyer that has a picture i created myself. what i did was make a square, put 4 separate lines on top of it, then put the same square (except made it somewhat transparent by way of the fill options) and put it on top of it to so it would be transparent enough to be able to see a hint of the lines underneath...however, when I print it, it does not print what i see...it prints a the full solid background as if it were not transparent. how can i print it with the transparent effect i want? >-----Original Message----- >Stephanie what version of Publisher are y...

Unable to Print Timesheets in BP
We recently installed BP, PDK and Great Plains. We are experiencing significant difficulty in printing the beautiful looking timesheet that displays when hitting the "Print" button in Business Portal. The timesheet data basically bleeds off of the right hand side of the page even on legal. Has anyone experienced the same issue? We are required to submit timesheets to our customers withour invoices. I wish these were formated with the weeks in two one week rows rather than one two week period all the way accross. And that it fit on letter sized paper! What we currently ...

Merge two excel files
I have two excel files with the same cell layout. Some of the entries in the first file are identical to the second file. How do I merge the two files so that the resulting file has no duplicates? Thanks in advance. Tom -- So long and thanks for all the fish! Tom, Copy the entries from the second file into the first, below the other entries (don't copy the header row). Then save the file under a new name. I'm going to assume that your data starts in cell A2, with headers in row 1, and extends down the page. In a column to the right of the data table, enter a formul...

Returning Data from a third cell in same row that meets two other
I'm looking for a formula that will return a result from a cell on a same row as two other cells that meet certain criteria. I'm sure there is a way to do this but i am a novice at this kind of stuff and can't seem to figure it out. For example i want a cell to = what is in column E when column A="36751" and when column B="Total Returns" The spreadsheet has 55000 rows. there will only be one instance where both these criteria are met. i want to use this to create a seperate spreadsheet with just info i need and can update on a daily basis. thanks in ...

how to have my titles move down as i scroll down the page
hi what i want to do is have the top line of the exel sheet move down the page and stay in veiw so i can easily see which field i am currently woorking on. can anyone tell me how to do this? yours david Click on the last row of heading (or row 1 if there is just one row) Use Windows Freeze best wishes -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from email "DAVIDPEOVER" <DAVIDPEOVER@discussions.microsoft.com> wrote in message news:7F17D28F-2A71-437B-BF81-AEEB9D880B15@microsoft.com... > hi what i want to do is have the top line of the exel sheet move...

Save data before printing
Hello all, An acquiantence is programming in Excel 2003 and has a sheet where theuser enters receipt data. When he is done, he clicks a boton to copythe data from the sheet to another in tabular form withinthe same workbook. What he needs to do is to implement a lock so that the user can't print out the receipt until after he has clicked the boton. His button click event code is the following: Private Sub CommandButton1_Click() Application.ScreenUpdating = False 'Copy data to BD2 sheet Sheets("BD2").Unprotect With Sheets("BD2").Range("A1000&qu...

Two users on a network editing documents simultaneously in word 20
My office just upgraded from Word 2003 to Word 2007. We are on a network and share access to Word files. In Word 2003, if one user tried to open a file in which another user was working, a message would appear stating that the file was "locked for editing by (user)." It seems that with Word 2007, any user can open a file (and edit it) while another user is doing so as well. We do not want this to be the case, and just want the settings to be as they were with Word 2003 (i.e. if a document is in use, another user cannot access it simultaneously). Ideally, we'd lik...

Execl print to fit paper
how do you set a group of cells to print to fit (maximize to one page size, normally 8 1/2 x 11) on one (and only one) page? Select the cells to be printed, then: <File> <PrintArea> <SetPrintArea> Then: <File> <PageSetUp> <Page> tab, Then click on: "Fit To" 1 page wide by 1 page tall, Then <OK>. -- HTH, RD --------------------------------------------------------------------------- Please keep all correspondence within the NewsGroup, so all may benefit ! --------------------------------------------------------------------------- "...

Form pages
Is it possible to have a two page form and only print the first page or second page when needed.? Depending on your design, you should be able to use the File/Print dialog box selection to print 1 of 2, or 2 of 2 pages. But, forms are made for data entry, and viewing... not printing. Better that you develop a rptPageOne and a rptPageTwo and select either for printing from your form. -- hth Al Campagna Microsoft Access MVP http://home.comcast.net/~cccsolutions/index.html "Find a job that you love... and you'll never work a day in your life." &quo...

Checkbok & printing
I'd like to set up Excel to track my checkbook. I've got a spreadsheet made up that does that and let's me reconcile easily. Is there a way to take selected entries from the spreadsheet and have them "appear" in a check-style template and then print out the checks? I'm using Excel 2000 on Win XP Home SP 1. Thanks! <*((((><{ Fishy@Ocean.Net Hi Fishy, As a starting point see xlDynamic at: http://www.xldynamic.com/source/xld.xlFAQ0004.html --- Regards, Norman "<*(((><{" <Fishy@Ocean.Net> wrote in message news:c7nn72...

Printing updated customer information on a Receipt
Hello all, I modified the receipt to print the customer's total number of visits and total amount spent (both from the customer record) at the bottom of the receipt. The problem is that it is always printing the values as they stand before the last transaction. Example: if I create a new customer, do a tranaction ($20) and print the receipt, the number of visits and amount spent will show as zero. When I do a second transaction the receipt will print the values (visits 1, amount spent $20) as they stand at the end of the first transaction. Does anyone know how I can force the receip...

Sumif with two criteria #2
I need to add column c if column a and column b both meet my criteria. example A B C 1 X Y 3 2 S Y 1 3 X Y 2 4 X F 3 5 F Y 3 X AND Y 5 On Thu, 30 Oct 2003 13:06:29 -0800, "danperez@joannstores.com" <anonymous@discussions.microsoft.com> wrote: >I need to add column c if column a and column b both meet >my criteria. > >example > A B C >1 X Y 3 >2 S Y 1 >3 X Y 2 >4 X F 3 >5 F ...