Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Overiding MS Word Margins Yes / No Popup

Status
Not open for further replies.

brent01

Technical User
Jul 11, 2001
32
0
0
GB
I have setup a very, very basic vbscript to print several word documents.

The script is as follows - (I have left out most of the documents, as the lines are all the same, with only the dicument name being different)

Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()

objWord.PrintOut ,,,,,,,,,,,,"C:\IT Ops Daily Check Sheet.doc"
objWord.PrintOut ,,,,,,,,,,,,"C:\DCS Overnight And Midday Poll.doc"

objWord.Quit

An MS Word Window is opened, but I get a popup message for each document as follows -

"The Margins of section 1 are outside the printable area of the page. Do you want to continue? Yes / No"

Replying yes to each popup message will allow the documents to print, but is there any way of programatically preventing this popup box from appearing (other than changing the margins, of course)

Also once the vbscript has finished, the MS Word window stays open. Is objWord.Quit the write function? How can I get the MS Word window to close from the script.

Thanks for any help, in advance.


 
You may try this:
objWord.DisplayAlerts = False

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the suggestion PHV.

I tried this but I still get the same problem.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top