Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To use a unique identifier for each document, you will need to register each identifier outside the document, or use a method that determines a unique identifier based on the properties or content of the document itself. A simple example of the former is the file name which is unique within the file system and is available as a 'variable' inside the document. An example of the latter is a checksum calculated over the contents of the file. However, this checksum changes with every change in the document and is not sequential.

An abstract solution would be: use a register to connect each document to its number, e.g. a database with a table with auto-incrementing numbers and the document's path and file name. As you noticed, you must register once, and then reference the number by querying for the number belonging to the exact file. A macro of some sort could come in handy here, which is best saved in a document template.

Another abstract solution could be: use a method to determine the ID, for example by using a text file with just the previously used ID, and incrementing the number, and storing the number inside the document as a document property. (Again, this is probably a task for a macro.) You can then reference the stored number in the document content.