Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Numbering copies in Word 2002 2

Status
Not open for further replies.

noblehill

IS-IT--Management
Apr 11, 2001
84
FI
Hello! I have a small problem: let's say I want to print two hundred copies of my Word document. I can't just xerox the papers, because I want each document to be numbered. I don't mean page numbering, but "Copy 1, Copy 2, Copy 3" kind a thing. This is easy to do by combining the document with a spreadsheet with the right amount of numbers, I can just add the field to my document.

Something tells me there must be an easier way to do this just in Word, but I can't just find the right box to check in the printing settings. Or am I paranoid? :)
 
Thanks for the tip, Dreamboat! Adding a field was a good idea, I just haven't been able to find the right kind of numbering, all my printouts have number one in them... :(
 
1. make a text formfield where you want the text "Copy Nuimber x". Do not put the text in, just the text formfield. Name the formfield "PrintCopyNum"

Obviously, you can put the text formfield where ever you like (title page?...whatever), and in whatever format (font etc etc) you like.


2. Make a Sub with the following. Name it whatever you want. What it does is print single copies, but updates a text formfield with the current count of the print job. The total number to print is picked up from a inputbox.

Code:
Dim lngTotalPrint as Long, lngCurrentCount as Long
Dim var
' get total number to print
     lngTotalPrint = InputBox("Number of Copies to print?")
     lngCurrentCount = 1

' loop through count to print
For var = 1 to lngTotalPrint
  ' update text formfield
  ActiveDocument.FormFields("PrintCopyNum").Text = _
      "Print Copy " & lngCurrentCount & " OF " & _
          lngTotalPrint

' print one copy
  Application.PrintOut FileName:="", _
  Range:=wdPrintAllDocument, Item:= _
        wdPrintDocumentContent, Copies:=1

' increase current counter
  lngCurrentCount = lngCurrentCount + 1

Next
End Sub

Hope this helps



Gerry
 
Thanks for all your help, guys! I'll just have to stick to old methods here, because nothing seems to work. Anyway, I really do appreciate all your ideas and help.
 
Sorry to hear that. Did you try my suggestion? It does work. It prints any number of copies you want, plus adds a chunk of text that identifies the copy number. As in: "Copy 23 of 250". That chunk of text can be placed where ever you like.

If you like, I could send a sample file that demonstrates this.

Ooops! I did find an error! Replace .Text with .Result.

ActiveDocument.FormFields("PrintCopyNum").Text = _

should be

ActiveDocument.FormFields("PrintCopyNum").Result = _

If you tried my code, you would have got an error. Either try again, or post back here and I can send you a file.


Gerry
 
fumei,
Here's a star, and my thanks--your code was very helpful to me. I had awkwardly created a macro to do the same thing, but my code is about 4 pages long. [sadeyes] Yours is much more efficient! [2thumbsup]
 
Well thanks dcompto! Coming from you that is a real pleasure.

Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top