How do I generate a document number for documents on my server?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Does anyone know how to generate a document number for every document on a
server? In a Word file, for example, a number could appear in the footer
that is different from every other document on the server. This would make
searching for the document at a later date much easier. Any thoughts?
 
There are several ways to do this, all involving macro code and
administration. It's a lot of work, and very hard to get right in a
multi-user environment. How will it make searching for a document easier?
What do you want to have happen when users make copies of documents? How do
you tell the difference between a copy and a back-up?

If you're serious about document control, have a look at commercial document
control systems. There are quite a few of them, mostly quite expensive or
startlingly incompetent. A few are both.

Or look at Google's Desktop search, which is free.
 
You could modify the solution at
http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm. I would suggest storing
the number as a custom document property and displaying it with a
DocProperty code. If you don't want it easy to change, use a document
variable instead.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
That method won't work in a multi-user environment: numbers will be
duplicated for each user.
 
Hi Jezebel:

The solution in the article Charles referred to WILL work in a multi-user
environment provided you place the settings file involved on a Network drive
accessible to all.

Cheers

That method won't work in a multi-user environment: numbers will be
duplicated for each user.

--

Please reply to the newsgroup to maintain the thread. Please do not email
me unless I ask you to.

John McGhie <[email protected]>
Microsoft MVP, Word and Word for Macintosh. Consultant Technical Writer
Sydney, Australia +61 (0) 4 1209 1410
 
Jezebel,

Confirming John's comment. It appears that Doug Robbins answered a
similar quesiton as follows:

Sub AutoNew()
Order = System.PrivateProfileString("\\server\Counter.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
ActiveDocument.Bookmarks("Order").Range.InsertBefore Format(Order,
"00#")
End Sub

and create another macro in the template with the name FileSaveAs()
that
contains the following code:

Sub FileSaveAs()
Order = System.PrivateProfileString("\\server\Counter.Txt", _
"MacroSettings", "Order")
If Order = "" Then
Order = 1
Else
Order = Order + 1
End If
System.PrivateProfileString("\\server\Counter.txt", "MacroSettings", _
"Order") = Order
ActiveDocument.SaveAs FileName:="\\server\DocumentName Ref-06-" &
Format(Order, "00#")
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top