PageSetup object woes on Word for Mac

C

Clint McGee

The following code snippet works fine on Word XP (PC), but
when I run it in Word 98 or Word 2001 (both on the Mac),
it will not actually change the page setup. It looks like
it works if you view it as Page View, but when I look at
the page setup, it still shows the former page size. I am
trying to automate changing the page layout, adding text,
and printing, and this layout problem is what is holding
me back.

--------------------
'Changes the page setup to be 8.5x11 portrait
With ActiveDocument.PageSetup
.TopMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.BottomMargin = InchesToPoints(0.5)
.LeftMargin = InchesToPoints(0.5)
.Orientation = wdOrientPortrait
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
End With
---------------------
I also, tried using "ActiveDocument.PageSetup.PaperSize"
to change the paper size, but this gives an script error
on the Mac (an error with no description)... works fine on
the PC though. I've tried all these things on multiple
Macs with the same results. (even with different OS and
printer software)

Please help!
-Clint
 
W

Word Heretic

G'day "Clint McGee" <[email protected]>,

<chuckles>

How about just changing .PaperSize instead of the physical dimensions
:)

I been caught with that one too!

Clint McGee said:
The following code snippet works fine on Word XP (PC), but
when I run it in Word 98 or Word 2001 (both on the Mac),
it will not actually change the page setup. It looks like
it works if you view it as Page View, but when I look at
the page setup, it still shows the former page size. I am
trying to automate changing the page layout, adding text,
and printing, and this layout problem is what is holding
me back.

--------------------
'Changes the page setup to be 8.5x11 portrait
With ActiveDocument.PageSetup
.TopMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.BottomMargin = InchesToPoints(0.5)
.LeftMargin = InchesToPoints(0.5)
.Orientation = wdOrientPortrait
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
End With
---------------------
I also, tried using "ActiveDocument.PageSetup.PaperSize"
to change the paper size, but this gives an script error
on the Mac (an error with no description)... works fine on
the PC though. I've tried all these things on multiple
Macs with the same results. (even with different OS and
printer software)

Please help!
-Clint

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email: (e-mail address removed)
Products: http://www.geocities.com/word_heretic/products.html
Spellbooks: 728 pages of dump left and dropping...

The VBA Beginner's Spellbook: For all VBA users.
 

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

Similar Threads


Top