L
Lisa
Hi. I'm new to Word VBA as of almost a week ago. I've been trying
to get the program to paginate starting at the current page starting
at number 1000. I'm hoping eventually to change the 1000 to a number
of the user's choice.
However, I have run into some difficulty ... I did this based upon
recording a macro, and the two commented out lines of code below when
not commented out have an error message : The requested member of the
collection does not exist.
I have been testing it out by creating a four page document, with
trying to put Page 1000 on page 3.
What does the error code mean? How do I fix it? Any other help you
can provide?
Thanks a lot
Sub Macro4()
'
' Macro4 Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
'ActiveDocument.AttachedTemplate.BuildingBlockEntries("Plain
Number 3").
' Insert Where:=Selection.Range, RichText:=True
' If not commented out, what do these two lines above do?
' How do you get them to work right?
' Error: 5941: The requested member of a collection does not
exist.
With Selection.HeaderFooter.PageNumbers
.NumberStyle = wdPageNumberStyleArabic
.HeadingLevelForChapter = 0
.IncludeChapterNumber = False
.ChapterPageSeparator = wdSeparatorHyphen
.RestartNumberingAtSection = True
.StartingNumber = 1000
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
to get the program to paginate starting at the current page starting
at number 1000. I'm hoping eventually to change the 1000 to a number
of the user's choice.
However, I have run into some difficulty ... I did this based upon
recording a macro, and the two commented out lines of code below when
not commented out have an error message : The requested member of the
collection does not exist.
I have been testing it out by creating a four page document, with
trying to put Page 1000 on page 3.
What does the error code mean? How do I fix it? Any other help you
can provide?
Thanks a lot
Sub Macro4()
'
' Macro4 Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or
ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
'ActiveDocument.AttachedTemplate.BuildingBlockEntries("Plain
Number 3").
' Insert Where:=Selection.Range, RichText:=True
' If not commented out, what do these two lines above do?
' How do you get them to work right?
' Error: 5941: The requested member of a collection does not
exist.
With Selection.HeaderFooter.PageNumbers
.NumberStyle = wdPageNumberStyleArabic
.HeadingLevelForChapter = 0
.IncludeChapterNumber = False
.ChapterPageSeparator = wdSeparatorHyphen
.RestartNumberingAtSection = True
.StartingNumber = 1000
End With
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub