View Single Post
  #17   Report Post  
Posted to microsoft.public.word.docmanagement
Patty Patty is offline
external usenet poster
 
Posts: 31
Default It worked, but...

Jay,
I followed your instructions and added your code to my macro to make a new
number sequentially appear on my new PO, however the template that I used has
a [100] and my new number appears before it. How do I get rid of the [100]
from the original template?
Thanks-
Pat

"Jay Freedman" wrote:

Item 1: To let multiple people use the template, store it in a network
folder that all can access. I'll assume the folder is called
\\companyserver\publicshare\templates but it could be any valid name like
this, or it could be a folder on a mapped network drive (like N:\templates).
Then each person in their own copy of Word needs to go to Tools Options
File Locations, and modify the "Workgroup templates" location to point to
that shared folder.

This will cause the Purchase Order template -- and any other templates you
store there -- to appear in the list in the File New dialog in Word.
People should use the File New command to create new documents based on
the template. Nobody should actually _open_ the template (from File Open)
unless some change has to be made in the template itself.

Item 2: You need to copy the AutoNew macro code from the article and put it
into the Purchase Order template. Instructions for how to do this are at
http://www.gmayor.com/installing_macro.htm. Then you need to make a few
changes in the code to suit your requirements:

- There are two places in the macro that refer to a file named
"C:\Settings.Txt". In both places, change the path of the file to the same
folder where the template is stored, for example,
"\\companyserver\publicshare\templates\Settings.Tx t". (Don't try to use a
mapped drive path here; it'll cause errors if different people have the
location mapped to different drive letters.)

- Locate the lines of code that say

If Order = "" Then
Order = 1

and change them to

If Order = "" Then
Order = 1050

to start the numbering where you want.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.

Hettie wrote:
Can you show me an actual example of how the formula should work. I
am very new with macros and don't understand the direction to the
link below. I have a Purchase Order document in Word that is a
template. I need to be able to start at 1050 and have the number
increase each time I open it. I will need multiple people to be able
to access this document from our company server. Can you help?

"Jay Freedman" wrote:

I assume you're using a solution like the one in
http://www.word.mvps.org/FAQs/MacrosVBA/NumberDocs.htm, where the
current number is held in an external settings file
("C:\Settings.Txt" is the name used in that article).

The solution I suggest is that you create a separate settings file
for each type of purchase order. Then in each template, include the
name of the corresponding settings file. So, for instance, the
template used to make Admin P.O.s would have its AutoNew macro work
on AdminSettings.txt, while the one for Marketing P.O.s would work on
MarketingSettings.txt.

There is an alternative that uses a single settings file containing
different numbers for different templates. In this scheme, the file
name is the same in all templates, but each template uses a different
name in place of the "MacroSettings" parameter. (Within the settings
file, this becomes a label for a section of the settings. That
happens automatically.)

A final point: If multiple users will be creating P.O.s from these
templates, the settings file(s) should be on the server rather than
on a single workstation. This is mentioned, but not prominently, in
the article: "if more than one user needs access to the up-to-date
number, a text file can be saved in a shared area on the network."
To make this work, the file name in the AutoNew macros must contain
the path to the share instead of "C:\...".

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.