View Single Post
 
Old 05-25-2012, 12:04 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi yessmarie,

You'll need to either have an editable formfield the macro can output the numbers to or unprotect the form so that they can be added. The unprotection can be done in code, as can re-protecting the form afterwards but, if the form is password protected, you'll need to supply the password via an inputbox or by hard-coding.

The simplest approach would be to update a 'counter' formfield via a FilePrint macro. For example:
Code:
Sub FilePrint()
With ActiveDocument
  If .Bookmarks.Exists("Counter") Then
    With .FormFields("Counter")
      .Result = .Result + 1
    End With
  End If
End With
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote