Thread: [Solved] Sequential Numbering
View Single Post
 
Old 12-14-2011, 03:02 PM
jdwoods jdwoods is offline Windows XP Office 2003
Novice
 
Join Date: Dec 2011
Posts: 4
jdwoods is on a distinguished road
Default

Code:
Option Explicit
Sub ElevatorInventoryControlTicket()
Dim iStart As Integer, iEnd As Integer, i As Integer
On Error GoTo ErrHandler
With ActiveDocument.Shapes(1).TextFrame.TextRange.Fields(1)
iStart = CInt(InputBox("What is the first certificate to print?", "Print Certificates From", Split(Split(.Code.Text, "")(0), "=")(1)))
iEnd = CInt(InputBox("What is the last Certificate to print?", "Print Certificates To", iStart))
If iStart = 0 Or iStart > iEnd Then Exit Sub
For i = iStart To iEnd
.Code.Text = "=" & i & " \#0"
.Update
ActiveDocument.PrintOut
Next
End With
ErrHandler:

End Sub
This is the code that I am using.
Reply With Quote