How to suppress warning dialog?

J

Jeffery B Paarsa

Hello,

I have a VBA macro which its last command is .printout. Since the template
I am using prints out of the set margin I always get this nonsense dialog box
of "The margins of section 1 are set outside then printable area of the page.
Do you want to continue?" Yes or No... Off course my response is always Yes
and my printout is okay with no problem... Does anybody know how I can
suppress this dialog box from being appear with out changing the page setup?
 
J

Jezebel

You could use SendKeys to respond to it automatically. You can't suppress
it, as far as I know (it's not subject to the DisplayAlerts settings).
 
J

Jean-Yves

Hi,

Was answered previously
Setting the alerts to none does not work if backgroung printing option is
selected.
Try this :
Dim temp as boolean
temp = Application.Options.PrintBackground
Application.Options.PrintBackground = False
Application.DisplayAlerts = wdAlertsNone
ActiveDocument.PrintOut
Application.DisplayAlerts = wdAlertsAll
Application.Options.PrintBackground = temp
Regards
Jean-Yves
 

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