Disabling alerts

F

firstcasualty

How do I prevent Word from alerting me to the fact that my margins are
out of the print range (which in itself is not a problem) every time I
print? I've tried running these in Word VB but no change.

Sub DisableAlerts()
Application.DisplayAlerts = wdAlertsNone
End Sub


Sub DisableAlerts()
Application.DisplayAlerts = False
End Sub
 
H

Helmut Weber

Hi,

by Jonathan West

"You're doing nothing wrong,
it is just that Word doesn't suppress all error
messages when you set DisplayAlerts = wdAlertsNone."


--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 
H

Helmut Weber

Hmm...

.... as don't have a printer here at home at all,
testing is possible only by printing to a file.
However, if I print by using a macro, like:
ActiveDocument.PrintOut , , , "c:\print.prn"
I don't get an alert at all.

Seems to be similar to closing a changed document.
If you try it from the user interface,
you get a warning.

Not so if you close a doc in a macro.

And besides that, if I understand the help correctly,
diplayalerts settings are valid only for the macro
they are located in. Maybe for other macros too,
if called from the first one.

If someone knows better, she or he will speak up.

HTH

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"
 

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