How do I suppress the 'print outside margins' error?

B

B Carlson

I am trying to print a very long document in Word 2002 with dozens (if not
hundreds) of sections in it. Regardless of the settings I tweak, I get this
message for every section:

"The margins of section X are set outside the printable area of the page.
Do you want to continue?"

How do I suppress this message so I can print the entire document without
having to click "OK" dozens (if not hundreds) of times? I saw another post
about how to do this with VBA, but I don't have that, so I'm hoping for a
solution within Word itself.

Thanks for your help!
 
L

Lene Fredborg

You need a macro to prevent the warning. When you have Word, I am quite sure
you also have VBA - it is included. See the links at the end of this post for
help on installing macros.

If you install one of the macros below, you can use that macro when you
print documents like the one you describe and use the standard Print command
for "normal" documents.

Two different macro versions are included below. Both macro versions
suppress the margins warning. If you add one of the macros to your
Normal.dot, you can use that macro for printing your special documents. You
could assign a keyboard shortcut to the macro or assign the macro to a
toolbar button in order to make it easy to print your documents.

------------------------
Macro 1- prints the active document without showing the Print dialog box:

Sub Print_ShowNoWarning_1()
With Application
'Turn off DisplayAlerts
.DisplayAlerts = wdAlertsNone
'Print document
'Background print must be turned off to prevent message
.PrintOut Background:=False
'Turn on DisplayAlerts again
.DisplayAlerts = wdAlertsAll
End With
End Sub

------------------------
Macro 2 - shows the Print dialog box. Use this version if you want to be
able to specify other print settings:


Sub Print_ShowNoWarning_2()
Dim bPrintBackgroud As Boolean

'Save current setting of background printing
bPrintBackgroud = Options.PrintBackground

Options.PrintBackground = False
'Turn off DisplayAlerts
Application.DisplayAlerts = wdAlertsNone
Dialogs(wdDialogFilePrint).Show
'Turn on DisplayAlerts again
Application.DisplayAlerts = wdAlertsAll

'Set original background printing setting
Options.PrintBackground = bPrintBackgroud
End Sub

For help on installing macros, see:
http://www.gmayor.com/installing_macro.htm
For help on assigning a macro to a toolbar, see:
http://word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToToolbar.htm
For help on assigning keyboard shortcuts, see:
http://www.word.mvps.org/FAQs/Customization/AsgnCmdOrMacroToHotkey.htm

--
Regards
Lene Fredborg
DocTools - Denmark
www.thedoctools.com
Document automation - add-ins, macros and templates for Microsoft Word
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top