![]() |
|
#18
|
||||
|
||||
|
I think it is easier to deal with Content Controls so I would do this with the following code after putting a Content Control titled "CertNumber" in the location you want the number to appear.
Code:
Sub JHA_Print()
Dim iStart As Integer, iEnd As Integer, i As Integer, aCC As ContentControl, sVal As String
'On Error GoTo ErrHandler
Set aCC = ActiveDocument.SelectContentControlsByTitle("CertNumber")(1)
sVal = aCC.Range.Text
If Not IsNumeric(sVal) Then
iStart = 1
Else
iStart = CInt(sVal) + 1
End If
iEnd = CInt(InputBox("What is the last Certificate to print?", "Print Certificates To", iStart + 1))
If iStart > iEnd Then Exit Sub
With ActiveDocument
For i = iStart To iEnd
aCC.Range.Text = i
.PrintOut
Next
End With
'ErrHandler:
End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Sequential numbering in Word - Unique numbers for table rows | krips | Word | 1 | 03-21-2018 05:06 AM |
| Sequential numbering within Word | Earthly Way | Word VBA | 1 | 12-02-2015 07:36 PM |
| New to Word VBA - Sequential Numbering | techmendz | Word VBA | 11 | 08-07-2014 08:20 AM |
Sequential Numbering
|
jdwoods | Word VBA | 7 | 12-16-2011 05:11 AM |
Sequential Page Numbering of Multiple Word Docs
|
bobmard | Word | 8 | 08-24-2011 08:51 AM |