Consulting

Results 1 to 10 of 10

Thread: disable margin warning using Macro

  1. #1

    disable margin warning using Macro

    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

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Quote Originally Posted by macropod View Post
    thanks, but for some reason, this code doesn't work with MS word 2010.

  4. #4
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    Did you change:
    Background:=True
    in your code to:
    Background:=False
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  5. #5
    Quote Originally Posted by macropod View Post
    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

  6. #6
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You still have:
    Background:=True
    in your code and you don't need the separate:
    Application.PrintOut Background:=False
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  7. #7
    Quote Originally Posted by macropod View Post
    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

  8. #8
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    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.
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  9. #9
    Quote Originally Posted by macropod View Post
    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

  10. #10
    Quote Originally Posted by macropod View Post
    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! ))

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •