|
-
Oct 29th, 2003, 10:25 PM
#1
Thread Starter
New Member
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
-
Oct 30th, 2003, 07:13 PM
#2
Fanatic Member
***? 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:
' Multipy inches by 72 to get points because InchesToPoints in Word may
' return results with rounding errors (example: InchesToPoints(0.9) * 10 = 647.999)
If .TopMargin <> (72 * 0.9) Or _
.BottomMargin <> (72 * 0.9) Or _
.LeftMargin <> (72 * 0.25) Or _
.RightMargin <> (72 * 0.25) Then
MsgBox "Page Margins are not correct"
End If
-
Oct 30th, 2003, 10:39 PM
#3
Thread Starter
New Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|