PDA

View Full Version : [SOLVED:] disable margin warning using Macro



dondondonley
11-24-2020, 12:04 AM
Hi, I have tried copy pasting all of the vba code to disable the margins warning of MS word but to no avail. Can someone let me know what I'm doing wrong?

Thank you in advance! This is a simple print function:

Sub Macro2()
'
' Macro2 Macro
'
Application.DisplayAlerts = wdAlertsNone
ActivePrinter = "EPSON L3110 Series (Copy 1)"


Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

End Sub

macropod
11-25-2020, 04:01 AM
See: Print Without Margins Warning (thedoctools.com) (https://www.thedoctools.com/word-macros-tips/word-macros/print-without-margins-warning/)

dondondonley
11-26-2020, 12:13 AM
See: Print Without Margins Warning (thedoctools.com) (https://www.thedoctools.com/word-macros-tips/word-macros/print-without-margins-warning/)

thanks, but for some reason, this code doesn't work with MS word 2010.

macropod
11-26-2020, 12:28 AM
Did you change:
Background:=True
in your code to:
Background:=False

dondondonley
11-26-2020, 12:45 AM
Did you change:
Background:=True
in your code to:
Background:=False

I tried it with and without. This is my latest code. Sorry just an amateur macro user.

-------------

ActivePrinter = "EPSON L120 Series (Copy 1)"


Application.DisplayAlerts = wdAlertsNone




Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=True, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0


Application.PrintOut Background:=False


Application.DisplayAlerts = wdAlertsAll

macropod
11-26-2020, 04:16 AM
You still have:
Background:=True
in your code and you don't need the separate:
Application.PrintOut Background:=False

dondondonley
11-26-2020, 04:32 AM
You still have:
Background:=True
in your code and you don't need the separate:
Application.PrintOut Background:=False

oh yeah...thanks! I did not see that. will change it to:

ActivePrinter = "EPSON L120 Series (Copy 1)"

Application.DisplayAlerts = wdAlertsNone

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=False, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

Application.PrintOut Background:=True

Application.DisplayAlerts = wdAlertsAll

macropod
11-26-2020, 05:24 AM
Now you've changed:
Application.PrintOut Background:=False
to:
Application.PrintOut Background:=True
instead of deleting that line. As I said, you don't need it. Changing it the way you have instead of deleting it simply reintroduces the problem.

dondondonley
11-26-2020, 06:11 AM
Now you've changed:
Application.PrintOut Background:=False
to:
Application.PrintOut Background:=True
instead of deleting that line. As I said, you don't need it. Changing it the way you have instead of deleting it simply reintroduces the problem.


Oh ok. Thank you for the help. So I'll just take it out. Let me try this then:

ActivePrinter = "EPSON L120 Series (Copy 1)"

Application.DisplayAlerts = wdAlertsNone

Application.PrintOut FileName:="", Range:=wdPrintAllDocument, Item:= _
wdPrintDocumentWithMarkup, Copies:=1, Pages:="", PageType:= _
wdPrintAllPages, Collate:=True, Background:=False, PrintToFile:=False, _
PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0

Application.DisplayAlerts = wdAlertsAll

dondondonley
11-26-2020, 06:26 PM
Now you've changed:
Application.PrintOut Background:=False
to:
Application.PrintOut Background:=True
instead of deleting that line. As I said, you don't need it. Changing it the way you have instead of deleting it simply reintroduces the problem.

thank you again for your help. We got it to work. Sending good vibes to you half a world away! :)))