Thread: [Solved] Continuous Numbering
View Single Post
 
Old 01-21-2018, 04:10 PM
gostgost gostgost is offline Windows 7 32bit Office 2016
Novice
 
Join Date: Jan 2018
Posts: 3
gostgost is on a distinguished road
Default Continuous Numbering

Hello,

I am using the below macro (borrowed) on a document that I have, when I try and run the macro on my document (word 2016) it does nothing. Please help.
Thanks, Dave

Code:
Sub FilePrint()
Dim lStart As Long, lEnd As Long, i As Long
On Error GoTo ErrHandler
With ActiveDocument
  lStart = CInt(InputBox("What is the first Report to print?", _
    "Print Report From", .CustomDocumentProperties("Counter").Value + 1))
  lEnd = CInt(InputBox("What is the last Report to print?", _
    "Print Report To", lStart))
  If lStart = 0 Or lStart > lEnd Then GoTo ErrHandler
  For i = lStart To lEnd
    .CustomDocumentProperties("Counter").Value = i
    .Fields.Update
    If i = lStart Then
      With Application.Dialogs(wdDialogFilePrint)
        If .Show = 0 Then GoTo ErrHandler
      End With
    End If
    If i > lStart Then ActiveDocument.PrintOut
  Next
End With
ErrHandler:
End Sub

Last edited by macropod; 01-23-2018 at 11:01 AM. Reason: Added code tags
Reply With Quote