Adding a counter in a document

A

Aptiva Dave

I need to create an invoice with a counter for the invoice number. Program will be opened and closed through out the day and the counter needs to keep up with the number of times the invoice is printed. Can any one give me some tips on just how to do that?
 
L

Larry

This is a discussion group for helping people with Microsoft Word.
Partisan political messages don't belong here.
 
J

Jezebel

You need to decide where to store the running count. My preference is a
CustomDocumentProperty in the invoice template, because you can open the
template itself and reset the counter when you need to. Add an AutoNew macro
to the invoice template -- this runs each time a document is created using
that template. Read the Property from the template, add it as a
customproperty to the document, then increment the property and write it
back to the template.

In the body of the invoice, use a DocProperty field to display the value.

No Bush in 2004 indeed! The sooner the world is free of this bastard, the
sooner we can hope for peace and decency.



Aptiva Dave said:
I need to create an invoice with a counter for the invoice number.
Program will be opened and closed through out the day and the counter needs
to keep up with the number of times the invoice is printed. Can any one
give me some tips on just how to do that?
 
J

Jonathan West

Aptiva Dave said:
I need to create an invoice with a counter for the invoice number.
Program will be opened and closed through out the day and the counter needs
to keep up with the number of times the invoice is printed. Can any one
give me some tips on just how to do that?

How to save a document using a filename that gets incremented
by 1 each time if the filename already exists
http://word.mvps.org/FAQs/MacrosVBA/SaveIncrementedFilename.htm
 
D

Doug Robbins

See the article "Creating sequentially numbered documents (such as
invoices)" at:

http://word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm


--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
Aptiva Dave said:
I need to create an invoice with a counter for the invoice number.
Program will be opened and closed through out the day and the counter needs
to keep up with the number of times the invoice is printed. Can any one
give me some tips on just how to do that?
 

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

Top