Results 1 to 6 of 6
  1. #1
    Lounger
    Join Date
    Jan 2002
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Avoiding a dialog box in Word (Word97)

    I have macro to print a document in Word 97. I want to print beyond the margins reported by Word. When printing, one gets the dialog box "The margins of section1 are outside the printable area of the page. Do you want to continue? Yes/No". As I always wnat to continue, is they any way, the dialog box can be avoided or have "Yes" automatically pressed.

    VBA prints using ActiveDocument.PrintOut Copies:=nNumberCopies, Range:=sPrintRange, Pages:=sPages
    or similar commands.

    Thanks

  2. Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoiding a dialog box in Word (Word97)

    Chris, I have successfully used the following code to avoid a warning that a selected worksheet is about to be deleted in MS Excel 97 through to MS Excel 2002. It might be what you could try.

    <hr> Application.DisplayAlerts = False
    ActiveWindow.SelectedSheets.Delete
    Application.DisplayAlerts = True<hr>
    So that any other wanted messages are not missed, I usually turn on the display alerts after the action I do not want the user to see on screen.
    HTH, Leigh

  4. #3
    Lounger
    Join Date
    Jan 2002
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoiding a dialog box in Word (Word97)

    Thanks Leigh,

    I tried the commands you suggested and Application.DisplayAlerts = wdAlertsNone, but unfortunately I still receive the dialog box. According to the Help this should work for "certain alerts and messages". Unfortunately, this dialog box is not one of the boxes.

    Any other ideas?

    Thanks

  5. #4
    Lounger
    Join Date
    Jan 2002
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoiding a dialog box in Word (Word97)

    Hi All

    I have just found a solution at http://www.mvps.org/word/FAQs/MacrosVBA/Ou...intableArea.htm. It seems that one has to turn off background printing : Background:=False .

    I do not know why this is so, but it does work. Thanks Leigh for the initial direction

    Hyperlinks added- Mod

  6. #5
    3 Star Lounger
    Join Date
    Jan 2001
    Location
    Brisbane, Queensland, Australia
    Posts
    245
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoiding a dialog box in Word (Word97)

    Thanks Chris

    I put that link with a list of handy pieces of info I store about VBA.

    Leigh

  7. #6
    2 Star Lounger
    Join Date
    Jun 2002
    Location
    vancouver, BC, Br. Columbia
    Posts
    109
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Avoiding a dialog box in Word (Word97)

    Thank you Chris - I've just spent an hour trying to figure this out.
    <img src=/S/bravo.gif border=0 alt=bravo width=16 height=30>

Posting Permissions

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