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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Margin warning when using macro to print

Status
Not open for further replies.

PhilBreau

Technical User
Joined
Dec 14, 2001
Messages
108
Location
CA
The margins of section 1 are set outside the printable area of the page. Do you wish to continue.

Sorry about the previous post.

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=True, PrintToFile:=False
Application.DisplayAlerts = True

What can I add to tell word to Ignore this error and just print?
 
Yes

Thank you, I have tried

Application.DisplayAlerts = False

I have also inserted it in just before
Application.PrintOut

Is there anywhere in the printout command where it can be used?

 
I don't know. I don't code. :(

Wouldn't it be easier to fix the document?

Find out the minimum page margins for this printer:

New doc.
Set page margins to 0 all the way around.
Hit Ok.
When you get Fix/Ignore, choose Fix.
What are margins now? This should show you minimum possible margins for loaded printer.
You may only need to change a margin slightly instead of dealing with the code... Anne Troy
Word and Excel Macros
Coming soon: wX
 
Thank you for your reply. I did figure it out by luck. I used some old code from the past:


Application.DisplayAlerts = False



Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="", PageType:=wdPrintAllPages, _
Collate:=True, Background:=False, PrintToFile:=False

Application.Quit (wdDoNotSaveChanges)




The "Application.DisplayAlerts = False" should have taken care of it. When I added the reset of the code, the document printed with out interruption.
 
Cool. But you do realize you could be losing the edges of letters, right? I just fixed a doc last night where it was losing the final letter on the right-hand side of a landscaped page, which happens to be the last edge that my printer prints. It needs those edges to pull the paper through. Better carefully check that nothing is being cut off. Anne Troy
Word and Excel Macros
Coming soon: wX
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top