Print Numbered (or Dated) Copies

Home Up Odds & Ends Photo Gallery Search Contact Me Privacy Notice

 

 

The information in this website is provided without risk or obligation and free of charge.  However, if you have benefitted from my efforts here and would like to make a contribution to help me continue and maintain this work then any donation will be greatly appreciated. Please click the adjacent button to access PayPal.  Thank you.
 

Here is a microsoft Word macro that you can run whenever you want to print sequentially numbered copies of your document.  Just position your cursor where you want the sequential number to appear, run the macro, and follow the prompts.

 

Sub PrintNumberedCopies()
Dim NumCopies As String
Dim StartNum As String
Dim Counter As Long
Dim oRng As Range

If MsgBox("The copy number will appear at the insertion point." _
    & " Is the cursor at the correct position?", _
    vbYesNo, "Placement") = vbNo Then End
If ActiveDocument.Saved = False Then
    If MsgBox("Do you want to save any changes before" & _
        " printing?", vbYesNoCancel, "Save document?") _
        = vbYes Then
        ActiveDocument.Save
    End If
End If
StartNum = Val(InputBox("Enter the starting number.", _
    "Starting Number", 1))
NumCopies = Val(InputBox("Enter the number of copies that" & _
    " you want to print", "Copies", 1))
ActiveDocument.Bookmarks.Add Name:="CopyNum", Range:=Selection.Range
Set oRng = ActiveDocument.Bookmarks("CopyNum").Range
Counter = 0
If MsgBox("Are you sure that you want to print " _
    & NumCopies & " numbered " & " copies of this document", _
    vbYesNoCancel, "On your mark, get set ...?") = vbYes Then
    While Counter < NumCopies
        oRng.Delete
        oRng.Text = StartNum
        ActiveDocument.PrintOut
        StartNum = StartNum + 1
        Counter = Counter + 1
    Wend
End If
End Sub

With a little modifications you can also print pages dated sequentially for use as a daily planner etc.:

Sub PrintSeqDatedCopies()
Dim i As Long
Dim d As Date
Dim pStrDate As String
Dim oRng As Range
Dim NumCopies As Long
If MsgBox("The date will appear at the insertion point." _
  & " Is the cursor at the correct position?", _
  vbYesNo, "Placement") = vbNo Then End
If ActiveDocument.Saved = False Then
  If MsgBox("Do you want to save any changes before" & _
     " printing?", vbYesNoCancel, "Save document?") _
     = vbYes Then
     ActiveDocument.Save
  End If
End If
On Error Resume Next
Date_Err_Reentry:
  d = CDate(InputBox("Enter the starting date.", _
      "Starting Number", Date))
  If Err.Number = 13 Then
    MsgBox "Invalid date format"
    Err.Clear
    GoTo Date_Err_Reentry
  End If
On Error GoTo 0
NumCopies = Val(InputBox("Enter the number of copies that" & _
    " you want to print", "Copies", 1))
ActiveDocument.Bookmarks.Add Name:="Date", Range:=Selection.Range
Set oRng = ActiveDocument.Bookmarks("Date").Range
i = 0
If MsgBox("Are you sure that you want to print " _
  & NumCopies & " sequentially dated " & " copies of this document", _
  vbYesNoCancel, "Print Confrimation") = vbYes Then
  While i < NumCopies
    oRng.Delete
    d = DateAdd("d", i, d)
    pStrDate = Format(d, "dddd MMM dd, yyyy")
    oRng.Text = pStrDate
    oRng.Font.Size = "36"
    ActiveDocument.PrintOut
    i = i + 1
  Wend
End If
End Sub

 

 
This macro was adapted from code posted by Doug Robbins in the MVP FAQ
Sequentially numbering multiple copies of single document using a macro
 

Need help applying macros?  See fellow MVP Graham Mayor's  Guide for Installing Macros 


Looking for something else?

Google