![]() |
|
|
|
#1
|
||||
|
||||
|
For your situation, it would probably be best to create a Custom Document Property named 'InvNum' in the template, then use code like:
Code:
Private Sub Document_New()
Application.ScreenUpdating = False
Dim InvNum As String
With ThisDocument
InvNum = .CustomDocumentProperties("InvNum") + 1
.CustomDocumentProperties("InvNum") = InvNum
'.Save
End With
With ActiveDocument
'Update the value stored in the document property
.CustomDocumentProperties("InvNum") = InvNum
'Update the fields in the document
.Fields.Update
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How do I do a Sequential Numbering?
|
gburya | Word VBA | 26 | 07-04-2017 03:29 PM |
Sequential Page Numbering of Multiple Word Docs
|
bobmard | Word | 8 | 08-24-2011 08:51 AM |
Editing multiple docs
|
frankdh | Word | 2 | 11-02-2010 10:59 AM |
| Please help with Numbering a document with multiple letters. | DJReality213 | Office | 1 | 01-15-2010 05:56 PM |
| Amend footer in multiple word docs? | compact | Word | 2 | 02-24-2009 09:40 AM |