Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Jun 2008
    Thanked 0 Times in 0 Posts

    Print macro (2007)

    I would like to create a macro that would automatically print each page as I come to the end of it. Is this possible?

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Silicon Valley, USA
    Thanked 94 Times in 90 Posts

    Re: Print macro (2007)

    Word 2007 monitors a number of events natively, such as saving and printing, and lets you attach code to those events. Microsoft has documented these events here:

    Application Events (MSDN)
    Document Events (MSDN)

    However, starting a new page is not one of the events that Word monitors natively. Thus, you would need to find another "event" that lets you check whether, say, the insertion point has reached a page number higher than the previously known maximum page number, and prints that previously known last page.

    One "event" that comes to mind is the user pressing the space bar. You can attach custom code to a keystroke using the KeyBindings Object. If you search on this board and on our VB/VBA board, you probably can find some examples for earlier versions of Word. Not sure what will happen if that code is run in Word 2007. <img src=/S/crossfingers.gif border=0 alt=crossfingers width=17 height=16>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts