none
Create a toolbar shortcut or keyboard macro for toggling "Show White Space between Pages in Print Layout view?"

    Question

  • Outlook 2010 Home and Business all latest service packs/ security hotfixes running on WIndows 7 64-bit with latest SP/security hotfixes.

    Issue:Microsoft Word does not respect this setting within Options-->display.  Most documents will respect this setting, but some will toggle the setting back to being checked; we always want this unchecked.   I have looked for a definitive reason why this occurs, but for now I'd just like to have a way to quickly enable this setting via keyboard macro/icon on toolbar.

    I understand double clicking the header area will show the headers, but the user specifically wants a single icon or keyboard command, because they have to do this constantly.  If anyone knows why this setting gets toggled with some documents and not others, that would be great as well.  We MUST have headers/footers always showing before sending for review.

    Thanks!  I give points/credit to all who respond.


    no

    Monday, April 02, 2012 4:12 PM

Answers

  • Whether white space displays is a document window setting, meaning it can be different for different documents. You can force all Word windows to hide the white space by adding the following pair of auto macros to the Normal template:
     
    Sub AutoOpen()
    ActiveWindow.View.DisplayPageBoundaries = False
    End Sub
     
    Sub AutoNew()
    ActiveWindow.View.DisplayPageBoundaries = False
    End Sub
     
    If Normal already contains these auto macros, just add the ActiveWindow.View.DisplayPageBoundaries = False line to them. For assistance, take a look at http://www.gmayor.com/installing_macro.htm.

    Stefan Blom, Microsoft Word MVP
    Monday, April 02, 2012 7:10 PM
  • The error message suggests that the macro runs before the document has been properly read into memory. You can add a delay to prevent such issues. Something like this should work:
     
    Sub AutoOpen()
    Call SetDesiredView
    End Sub
     
    Sub AutoNew()
    Call SetDesiredView
    End Sub
     
    Sub View2()
    ActiveWindow.View.DisplayPageBoundaries = True
    End Sub
     
    Sub SetDesiredView()
    Application.OnTime Now + TimeValue("00:00:05"), "View2"
    Exit Sub

    Stefan Blom, Microsoft Word MVP
    Saturday, April 07, 2012 12:10 AM

All replies

  • Whether white space displays is a document window setting, meaning it can be different for different documents. You can force all Word windows to hide the white space by adding the following pair of auto macros to the Normal template:
     
    Sub AutoOpen()
    ActiveWindow.View.DisplayPageBoundaries = False
    End Sub
     
    Sub AutoNew()
    ActiveWindow.View.DisplayPageBoundaries = False
    End Sub
     
    If Normal already contains these auto macros, just add the ActiveWindow.View.DisplayPageBoundaries = False line to them. For assistance, take a look at http://www.gmayor.com/installing_macro.htm.

    Stefan Blom, Microsoft Word MVP
    Monday, April 02, 2012 7:10 PM
  • This appeared to work for me in testing, but the user that I set this up for is getting "Run time error '4248':  The command is not available because no document is open.

    The macro code I used is:

    Sub DisplayPageBoundariesTRUE()
    '
    ' DisplayPageBoundariesTRUE Macro
    '
    '
    Sub AutoOpen()
    ActiveWindow.View.DisplayPageBoundaries = True
    End Sub
     
    Sub AutoNew()
    ActiveWindow.View.DisplayPageBoundaries = True
    End Sub
    End Sub
    

    (I used "True" unlike your example, because I always want headers and footers to show on every opened document.)


    no

    Friday, April 06, 2012 7:36 PM
  • The error message suggests that the macro runs before the document has been properly read into memory. You can add a delay to prevent such issues. Something like this should work:
     
    Sub AutoOpen()
    Call SetDesiredView
    End Sub
     
    Sub AutoNew()
    Call SetDesiredView
    End Sub
     
    Sub View2()
    ActiveWindow.View.DisplayPageBoundaries = True
    End Sub
     
    Sub SetDesiredView()
    Application.OnTime Now + TimeValue("00:00:05"), "View2"
    Exit Sub

    Stefan Blom, Microsoft Word MVP
    Saturday, April 07, 2012 12:10 AM