c_foster
asked on
Adding a sequential "Order number" to a one page MS Word form
I'm in the process of preparing a one-page order form for a charitable drive. I would like to include a sequential "order number" to the one page form that would increment with each page i print. This way i can ask particpants to include the order number on the memo line of their checks and be able to match the checks to the order form to ensure delivery of the proper product.
I found the SEQ information in MS Word 2007, however, on the 5 test pages i printed, they all came out with an order number of 1 instead of 1 on the first printed page, 2 on the second printed page, etc.
Does anyone know if this is possible? And if so, how?
Maximum points because i need this fast.
Thank you,
Carolyn
I found the SEQ information in MS Word 2007, however, on the 5 test pages i printed, they all came out with an order number of 1 instead of 1 on the first printed page, 2 on the second printed page, etc.
Does anyone know if this is possible? And if so, how?
Maximum points because i need this fast.
Thank you,
Carolyn
You could also use a template with a macro for this that when a new document is created from it, the number increases. This link should aid with that:
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You could use a document property, a document property field (DocProperty) and this macro set.
The code updates
Option Explicit
Sub FilePrint()
Dim dlg As Dialog
Set dlg = Dialogs(wdDialogFilePrint)
If dlg.Display = -1 Then
dlg.Execute
SetOrderNo
End If
End Sub
Sub FilePrintDefault()
ActiveDocument.PrintOut
SetOrderNo
End Sub
Sub SetOrderNo()
Dim prop As DocumentProperty
For Each prop In ActiveDocument.CustomDocumentProperties
If prop.Name = "OrderNo" Then
prop.Value = prop.Value + 1
Exit For
End If
Next prop
If prop Is Nothing Then
Set prop = ActiveDocument.CustomDocumentProperties.Add("OrderNo", False, msoPropertyTypeNumber, 1)
End If
ActiveDocument.Fields.Update
End Sub
The code updates
ASKER
This is the simplest solution.
Thank you
Thank you
The below should get you started. It assumes document is one page long, has one section and one footer type.
It increments the page number. If you want it to increase beyond 100, change that value to the highest number you want.
Open in new window
Do you need to save this number so that the next time it prints the number is the same?