R
Robert L. Sullivan
I recorded the following macro to change pagesetup entries on the entire
document. When I record it, it runs fine. When I try to execute it on a
document with an attached template (not normal.dot) I get "Runtime error
4608, value out of range). I can, however, run the macro on a document
created with the normal.dot template. Any ideas what this might be?
Thanks in advance.
Here is the macro as recorded....
Sub Macro11()
'
' Macro11 Macro
' Macro recorded 10/26/2006 by sullivanr
'
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.LeftMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
End Sub
document. When I record it, it runs fine. When I try to execute it on a
document with an attached template (not normal.dot) I get "Runtime error
4608, value out of range). I can, however, run the macro on a document
created with the normal.dot template. Any ideas what this might be?
Thanks in advance.
Here is the macro as recorded....
Sub Macro11()
'
' Macro11 Macro
' Macro recorded 10/26/2006 by sullivanr
'
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.LeftMargin = InchesToPoints(0.5)
.RightMargin = InchesToPoints(0.5)
.Gutter = InchesToPoints(0)
.HeaderDistance = InchesToPoints(0.5)
.PageWidth = InchesToPoints(8.5)
.PageHeight = InchesToPoints(11)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = True
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
End With
End Sub