A
Anne P.
Hi to all the wonderful MVPs out there. I have a question that I would like
to pose to you all regarding the "ideal" location for Word's Startup folder
for storing "Global Templates" or "Add-ins". I just read Dave Rado's
article on the MVPS.org website regarding templates. It appears from that
article that the "ideal" location for these types of templates is the
default one set by Microsoft which is: C:\Documents and
Settings\username\Application Data\Microsoft\Word\Startup.
I am creating a set of templates and macros for a NYC law firm. This is how
I have my system setup, however, I have encountered numerous problems doing
it this way. The main problem that I am encountering is that I cannot set a
reference to the "Global templates" in the VBE (Tools, References), as those
templates will be in a different location on each user's machine. I have
numerous macros that are needed by more than one template, so I stored them
in my global template (SKGlobal), but encountered a problem calling those
macros from the other templates. After much searching on Google and the
various Word message boards and posting my own messages on the message
board, I finally got the answer that I needed to do the following:
Application.Run "globaltemplate.modulename.macroname" to make them run.
Now I am encountering another problem which I have not been able to find an
answer to: how to call Functions that are stored in a global template. I
am using a Function called "StringtoArray" to separate a long string into
elements of an Array. Example: I have the following string (stored as an
AutoText entry in a global template):
Anne Pontillo|Partner|ALP|jap|NY|40566|(201)
476-1119|[email protected]|Yes
From the letter template, when this entry is chosen, I need to separate it
into an array using the "|" as the point to separate the elements. I need
to pass three arguments to the function to make it work: mstrUserInfo (the
string mentioned above), astrUserInfo() (the name of the array variable
declared in the project), and "|" (the character to use as the delimiter).
My problem is that this same function needs to be used in numerous
templates. Since I have not been able to find any information on how to
call the function from the global template when there is no reference set to
that global template, I have to copy these functions into every template
that needs to use that function. For example, from a recent posting if mine
on this forum, I am using an article from the MVPS website to "disable" the
X button on a userform. This procedure has two constants, 5 functions, and
1 variable that are declared first, and then approximately 21 lines of code
(including the comments) that needs to be placed in the Userform_Initialize
event. If I have 15 templates, I have to copy all of that code into each
and every template.
At last count, I have an additional 10-15 functions that have to be placed
in each template. All of this would be so much easier if I could place the
functions in the Global template (SKGlobal) and set a reference to it from
my other templates, or call the functions from my other templates.
So my question is this: is the Documents and Settings location the best one
to use for a startup location and, if so, how can I reduce the bloat on my
other templates by keeping my functions in the global template? I just did
an experiment with my letter template. The file size of the template was 97
KB. I deleted the functions that were stored there and the file size was
reduced to 63 KB. Therefore, each of my templates has an extra 34 KB
because the functions have to be stored in each template.
I would really appreciate any comments or suggestions regarding best
practices in setting this environment up, or advice on how to make it work
as is without all the extra work.
Anne P.
to pose to you all regarding the "ideal" location for Word's Startup folder
for storing "Global Templates" or "Add-ins". I just read Dave Rado's
article on the MVPS.org website regarding templates. It appears from that
article that the "ideal" location for these types of templates is the
default one set by Microsoft which is: C:\Documents and
Settings\username\Application Data\Microsoft\Word\Startup.
I am creating a set of templates and macros for a NYC law firm. This is how
I have my system setup, however, I have encountered numerous problems doing
it this way. The main problem that I am encountering is that I cannot set a
reference to the "Global templates" in the VBE (Tools, References), as those
templates will be in a different location on each user's machine. I have
numerous macros that are needed by more than one template, so I stored them
in my global template (SKGlobal), but encountered a problem calling those
macros from the other templates. After much searching on Google and the
various Word message boards and posting my own messages on the message
board, I finally got the answer that I needed to do the following:
Application.Run "globaltemplate.modulename.macroname" to make them run.
Now I am encountering another problem which I have not been able to find an
answer to: how to call Functions that are stored in a global template. I
am using a Function called "StringtoArray" to separate a long string into
elements of an Array. Example: I have the following string (stored as an
AutoText entry in a global template):
Anne Pontillo|Partner|ALP|jap|NY|40566|(201)
476-1119|[email protected]|Yes
From the letter template, when this entry is chosen, I need to separate it
into an array using the "|" as the point to separate the elements. I need
to pass three arguments to the function to make it work: mstrUserInfo (the
string mentioned above), astrUserInfo() (the name of the array variable
declared in the project), and "|" (the character to use as the delimiter).
My problem is that this same function needs to be used in numerous
templates. Since I have not been able to find any information on how to
call the function from the global template when there is no reference set to
that global template, I have to copy these functions into every template
that needs to use that function. For example, from a recent posting if mine
on this forum, I am using an article from the MVPS website to "disable" the
X button on a userform. This procedure has two constants, 5 functions, and
1 variable that are declared first, and then approximately 21 lines of code
(including the comments) that needs to be placed in the Userform_Initialize
event. If I have 15 templates, I have to copy all of that code into each
and every template.
At last count, I have an additional 10-15 functions that have to be placed
in each template. All of this would be so much easier if I could place the
functions in the Global template (SKGlobal) and set a reference to it from
my other templates, or call the functions from my other templates.
So my question is this: is the Documents and Settings location the best one
to use for a startup location and, if so, how can I reduce the bloat on my
other templates by keeping my functions in the global template? I just did
an experiment with my letter template. The file size of the template was 97
KB. I deleted the functions that were stored there and the file size was
reduced to 63 KB. Therefore, each of my templates has an extra 34 KB
because the functions have to be stored in each template.
I would really appreciate any comments or suggestions regarding best
practices in setting this environment up, or advice on how to make it work
as is without all the extra work.
Anne P.