Results 1 to 4 of 4
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Max page margins ((any))

    This is a kludgy solution: display the Page Setup dialog, set the margins to 0, and simulate pressing Enter 3 times, equivalent to letting Word fix the margins.

    Sub SetMargins()
    With Application.Dialogs(wdDialogFilePageSetup)
    .LeftMargin = 0
    .TopMargin = 0
    .RightMargin = 0
    .BottomMargin = 0
    SendKeys "{Enter}{Enter}{Enter}"
    .Show
    End With
    End Sub

  2. #2
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Max page margins ((any))

    Has anybody got a macro which can set the margins of a page to the maximum for the current printer? It's clear that Word knows about these as, if one sets the margins to 0, it will "fix" them. When trying to fit as much on some pages as possible and allowing for different printers, especially lasers vs inkjets (which have large bottom margins) it would be nice to be able to set margins easily to the best that the printer is capable of.


    Thanks

    Jim

  3. #3
    Star Lounger
    Join Date
    Feb 2001
    Location
    Auckland, North Island, New Zealand
    Posts
    73
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Max page margins ((any))

    Kludgy but clever. Thank you.

    It seems that even after setting up the maximum page size this way or manually the message "The margins.... are set outside the printable area" may still occur. Therefore I run a macro which allows the margins to be adjusted slightly.

    Regards,

    Jim

  4. #4
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Max page margins ((any))

    Adding the following lines at the start / end of Hans' Sub might do the trick:

    Application.DisplayAlerts = wdAlertsNone
    Application.DisplayAlerts = wdAlertsAll

Posting Permissions

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