Attribute VB_Name = "PageNum" Option Explicit ' ***************************** ' * PageNum ' * Adds pre-formatted page numbers to document ' * ' * ' * Copyright (c) 2001 Ryan Ginstrom ' * ' * You are free to do anything you want to this macro except sell it. ' * No warranties, etc. etc. ' ***************************** Private PageNum As Integer Sub DoPageNum() Dim UserPageNum As String If PageNum = 0 Then UserPageNum = InputBox("Starting page number", "Enter Pagenum") PageNum = val(UserPageNum) End If Selection.Font.ColorIndex = wdBlue Selection.Font.Bold = 1 Selection.TypeText Text:="[PAGE_" & Format(PageNum, "00") & "]" Selection.Font.ColorIndex = wdAuto Selection.Font.Bold = wdToggle Selection.TypeText Text:=vbCrLf + vbCrLf PageNum = PageNum + 1 End Sub Sub ResetPageNum() Dim UserPageNum As Variant UserPageNum = InputBox("New page number", "Enter Pagenum") PageNum = val(UserPageNum) DoPageNum End Sub