atw: VBA/Word2000 Gurus
- From: "Naomi Kramer" <nkr@xxxxxxxxx>
- To: austechwriter@xxxxxxxxxxxxx
- Date: Wed, 27 Oct 2004 15:08:34 +1000
Help please!
I'm trying to automate some page setup options, as I need to provide
each document in A4 and Letter page size.
Now for starters, I recorded a macro (call me lazy). It works until it hit
page size or margin settings, and then throws a temper tantrum.
Here's the code -
Sub GuideFormatA4Letter()
Selection.WholeStory
Selection.LanguageID = wdEnglishAUS
Application.CheckLanguage = False
If Options.CheckGrammarWithSpelling = True Then
ActiveDocument.CheckGrammar
Else
ActiveDocument.CheckSpelling
End If
With ActiveDocument.PageSetup
.BottomMargin = CentimetersToPoints(2.75)
.LeftMargin = CentimetersToPoints(1.5)
.RightMargin = CentimetersToPoints(2)
.TopMargin = CentimetersToPoints(3)
.Gutter = CentimetersToPoints(0.5)
.HeaderDistance = CentimetersToPoints(2)
.FooterDistance = CentimetersToPoints(1.5)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = True
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
ActiveDocument.Save
End Sub
I've tried to mix this around in all sorts of ways, but everything
pagesize- or margin-related is set to 9999999 and anything I put in is
'out of range' or not within the required measurements (if I put in
anything outrageous).
Help?
- Naomi
**************************************************
To post a message to austechwriter, send the message to
austechwriter@xxxxxxxxxxxxxx
To subscribe to austechwriter, send a message to
austechwriter-request@xxxxxxxxxxxxx with "subscribe" in the Subject field.
To unsubscribe, send a message to austechwriter-request@xxxxxxxxxxxxx with
"unsubscribe" in the Subject field.
To search the austechwriter archives, go to
www.freelists.org/archives/austechwriter
To contact the list administrator, send a message to
austechwriter-admins@xxxxxxxxxxxxx
**************************************************
Other related posts:
- » atw: VBA/Word2000 Gurus