Word: Macro for Printing Odd or Even Pages

ID: Q69403


The information in this article applies to:
  • Microsoft Word for MS-DOS, versions 3.x, 4.0, 5.0, 5.5, 6.0


SUMMARY

You can use the following macros to print all the of the odd pages or all the even pages starting from the current page in a Microsoft Word for DOS document. For example, if the cursor is currently on page 7, the macro prints pages 7, 9, 11, and so on, until it reaches the end of the document.

Note: The opening chevron (<<) is created by pressing CTRL+[, and the closing chevron (>>) is created by pressing CTRL+].

Word Versions 5.5, 6.0


   <<SET currentpage = page>>
   <ctrl end><<SET lastpage = page>>
   <<WHILE currentpage <= lastpage>>
        <menu>fp<alt s><<currentpage>><enter>
        <<SET currentpage = currentpage + 2>>
   <<ENDWHILE>> 

Word Version 5.0


   <esc>prn<enter>
   <esc>jp<<SET currentpage = field>><esc>
   <ctrl pgdn><esc>jp<<SET lastpage = field>><esc>
   <<WHILE currentpage <= lastpage>>
        <esc>po<tab 8>p<tab><<currentpage>><enter 2>
        <<SET currentpage = currentpage + 2>>
   <<ENDWHILE>> 

Word Version 4.0


   <esc>prn<enter>
   <esc>jp<<SET currentpage = field>><esc>
   <ctrl pgdn><esc>jp<<SET lastpage = field>><esc>
   <<WHILE currentpage <= lastpage>>
        <esc>po<tab 6>p<tab><<currentpage>><enter 2>
        <<SET currentpage = currentpage + 2>>
   <<ENDWHILE>> 

Word Versions 3.x


   <esc>prn<enter>
   <esc>jp<<SET currentpage = field>><esc>
   <ctrl pgdn><esc>jp<<SET lastpage = field>><esc>
   <<WHILE currentpage <= lastpage>>
        <esc>po<tab 4>p<tab><<currentpage>><enter 2>
        <<SET currentpage = currentpage + 2>>
   <<ENDWHILE>> 

Additional query words: 3.00 4.00 5.00 5.50 6.00

Keywords : kbmacro kbprint
Version : MS-DOS:3.x,4.0,5.0,5.5,6.0
Platform : MS-DOS
Issue type :


Last Reviewed: January 31, 2000
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.