![]() |
|
|
|
#1
|
||||
|
||||
|
Insert a text content control where you want the number to be displayed and title it Startnumber then:
Code:
Sub PrintJobs()
Dim i As Long, startnum As Long, lastnum As Long
startnum = InputBox("Enter the first job number to be printed", "Print Job Number", 1)
lastnum = InputBox("Enter the last job number to be printed", "Print Job Number", 1)
For i = startnum To lastnum
ActiveDocument.SelectContentControlsByTitle("Serialnumber").Item(1).Range.Text = i
ActiveDocument.PrintOut
Next
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#2
|
|||
|
|||
|
Hi Gmayor,
So I am trying the code and when I run it I get an error that states: Run-time error 5941 The requested member of the collection does not exist. I have put in a legacy text field and named it with Serialnumber and then what you said to name it as Startnumber and neither of them work and I get the same message. Is there another content control that I should be using? I am using word 2010 if that makes any difference. |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Looking for help with creating sequential serial number on one page
|
4ener | Word | 9 | 02-24-2019 07:50 AM |
| Sequential numbering in Word - Unique numbers for table rows | krips | Word | 1 | 03-21-2018 05:06 AM |
Creating alphanumeric incremental serial numbers
|
srinivasaru | Excel Programming | 8 | 04-03-2017 12:53 PM |
How to have sequential numbers appear in word header
|
woodyear99 | Word | 1 | 07-18-2016 08:28 PM |
Increase serial number for every print
|
atomtm | Word | 1 | 06-15-2012 05:39 AM |