Setting Margins Programmatically not working

E

erin.sebastian

Hi All,
I have a macro that produces a word document when all is said and done.
I have some code that goes and sets the margins programmatically, the
code is as follows:

Set myRange = ActiveDocument.Range

With myRange
.PageSetup.TopMargin = CentimetersToPoints(1)
.PageSetup.BottomMargin = CentimetersToPoints(1)
.PageSetup.LeftMargin = CentimetersToPoints(0.9)
.PageSetup.RightMargin = CentimetersToPoints(0.9)
.Font.Size = 11
.Font.Name = "Times New Roman"
End With

this works perfectly when i run it on my own machine but when it's run
on other people's machines it doesn't work at all. I should also note
that the font setting works on any computer and that the page margins
and font are different in Normal.dot on my computer and the others i
have tested on. Am i doing something wrong??
Thanks,
Erin
 
D

Dave Lett

Hi Erin,

What version of Word?
What does "doesn't work at all" mean? Are you getting an error message? Is
the page setup being altered but not to the dimensions you're requesting?
Anything else?

HTH,
Dave
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top