Results 1 to 3 of 3

Thread: checking page margin

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    9

    checking page margin

    Hello,

    How can I check page margins through VBA?? What I am doing is, I have created a template...all the documents created through this template needs to have page margin:
    top .9
    bottom .9
    left .25
    right .25

    Through VBA, i need to check if the document page margins are these, if not, throw a messagebox saying. "Page Margins are not correct"

    Any ideas.
    Regards

  2. #2
    Fanatic Member WorkHorse's Avatar
    Join Date
    Jul 2002
    Location
    Where you live.
    Posts
    591
    ***? Word is giving me rounding errors on the InchesToPoints function when the return value has exactly one decimal place. I multiplied the inches by 72 to get the points instead.

    VB Code:
    1. ' Multipy inches by 72 to get points because InchesToPoints in Word may
    2. ' return results with rounding errors (example: InchesToPoints(0.9) * 10 = 647.999)
    3. If .TopMargin <> (72 * 0.9) Or _
    4.    .BottomMargin <> (72 * 0.9) Or _
    5.    .LeftMargin <> (72 * 0.25) Or _
    6.    .RightMargin <> (72 * 0.25) Then
    7.     MsgBox "Page Margins are not correct"
    8. End If

  3. #3

    Thread Starter
    New Member
    Join Date
    Oct 2003
    Posts
    9
    Thanks WorkHorse...It really helped me!!

Posting Permissions

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



Click Here to Expand Forum to Full Width