• Avoiding a dialog box in Word (Word97)

    Author
    Topic
    #375851

    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

    Viewing 1 reply thread
    Author
    Replies
    • #613281

      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.

      [indent]


      Application.DisplayAlerts = False
      ActiveWindow.SelectedSheets.Delete
      Application.DisplayAlerts = True


      [/indent]
      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

    • #613398

      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

    Viewing 1 reply thread
    Reply To: Avoiding a dialog box in Word (Word97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: