Thread: [Solved] Word page numbering
View Single Post
 
Old 05-17-2025, 10:40 PM
gcp gcp is offline Windows 11 Office 2021
Novice
 
Join Date: Mar 2025
Posts: 17
gcp is on a distinguished road
Default Word page numbering

I recorded a macro to number pages. it includes:
Application.Templates( _
"C:\Users\gcpri\AppData\Roaming\Microsoft\Docu ment Building Blocks\1033\16\Built-In Building Blocks.dotx" _
).BuildingBlockEntries("Brackets 1").Insert Where:=Selection.Range, _
RichText:=True

When I run the macro it highlights the above in yellow and says:
"Run-time error '5941'. The requested member of the collection does not exist."
The cursor stops in the document in the footnote where the page number is to be inserted.
I have recorded the macro several times and occasionally the VB Editor refers to the building blocks but it does not stay there when I record other macros.
Allied to this is, when I record a macro can I allocate a project (or create a project) to contain the macro. The online help suggests that I have to go to the editor, start a new module and then cut and paste the code into that module.
Reply With Quote