Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Setting Margins for several active documents (Word 2000)

    I have a question from a student that alludes me...appreciate your help on this one, (and I've told her you will be guiding us).

    Question:
    Hi Nan,

    In MS Word 2000, we have a huge order that has been
    created as several separate documents. Each document needs to have the
    distance from the body to the footer increased. I know we can do that by
    going into Page Setup, Margins, Footer space from edge. My question is, is
    there a way to make the change once and have it apply to all of these
    documents, without having to open each document and make the change? We
    talking over 50+ documents that need the change.

    Thanks for any help you can provide, and we await your ever appreciated response.

    NMP
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Setting Margins for several active documents (Word 2000)

    This is easiest if all documents are in the same folder, and if that folder contains no other Word documents. Create a new folder for this purpose, if necessary.

    Sub AdjustMargin()
    ' Modify the path as needed, but keep the trailing backslash!
    Const strPath = "Cocs"

    Dim strFile As String
    Dim doc As Document

    ' First file name in folder.
    strFile = Dir(strPath & "*.doc")
    ' Loop through files in folder.
    Do While Not strFile = ""
    ' Open document.
    Set doc = Documents.Open(strPath & strFile)
    ' Code to set margin goes here. Modify as needed.
    doc.PageSetup.FooterDistance = InchesToPoints(0.9)
    ' Save and close document.
    doc.Close SaveChanges:=wdSaveChanges
    ' Next file name.
    strFile = Dir
    Loop

    ExitHandler:
    Set doc = Nothing
    Exit Sub

    ErrHandler:
    MsgBox Err.Description, vbExclamation
    Resume ExitHandler
    End Sub

  3. #3
    5 Star Lounger
    Join Date
    Jan 2001
    Location
    Jacksonville,NC, USA
    Posts
    705
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Setting Margins for several active documents (Word 2000)

    Thank you Hans...this worked beautifully.

    NMP
    NMP <img src=/S/cool.gif border=0 alt=cool width=15 height=15>

    If you can't convince them, confuse them. - Harry Truman <img src=/S/scratch.gif border=0 alt=scratch width=25 height=29>

Posting Permissions

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