![]() |
#1
|
|||
|
|||
![]()
I have been trying to add a sequential numbering macro to a word document so that each time it is opened the document is given a new number. The form in question is to record 'near misses' and it would be helpful to be able to open and print off the form each time it was required to be filled in with the next number.
I have tried the code below: Code:
But I get an error message at the line beginning 'System. Private' telling me that the _ is not a valid character. Any help gratefully received Last edited by macropod; 02-21-2013 at 07:09 PM. Reason: Added code tags & formatting |
#2
|
||||
|
||||
![]()
You code looks OK, though:
• you haven't declared your 'FormNumber' variable; • "Order" should read "FormNumber"; • your code inserts the form number before the bookmark, rather than updating it, which means any cross-references to the bookmark also won't update to reflect the form number; and • you may encounter permissions issues trying to write to C:\ For a different approach, see: https://www.msofficeforums.com/word/...iple-docs.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Geza59 | Word VBA | 18 | 01-15-2014 01:43 AM |
![]() |
Scottlambert | Excel | 1 | 05-11-2012 03:40 AM |
Document unique numbering / forms | JamesF | Word | 0 | 11-22-2010 03:52 AM |
Continuous page numbering in a merged document | dkeinath | Mail Merge | 0 | 07-30-2010 09:30 AM |
Please help with Numbering a document with multiple letters. | DJReality213 | Office | 1 | 01-15-2010 05:56 PM |