Hi Kevin
The short answer is no. But can we clarify some terminology here?
An MSI (MicroSoft Installer) is a package file used to install software on a
machine.
A macro is code written in VBA and accessible in the Visual Basic Editor
through Alt-F11.
A field is a thing written within the text of the document that tells Word
to do something (eg create a table of contents, or increment and display a
number in a sequence). Generally, you can see fields in grey shading if you
do Tools > Options > View and set "Field Shading" to Always. The shading
won't print. You can view the fields' codes using Alt-F9.
A caption is a short description of a table or a figure, eg "Figure 2 Map of
China" or "Table 3 Population of Brooklyn".
Working backwards, within a caption, the text (eg "Population of Brooklyn")
is provided by the user. The number is provided by a SEQ field. And the
first part ("Figure" or "Table") is a Label.
So, are we talking about custom Labels here?
If so, then, no, they are not stored in a template or a document. They are
stored in normal.dot, which is to say they are stored on a per-user basis.
(I seem to remember that this has been fixed in Word 2007.)
The best you can do is write a macro that creates the labels you require on
the user machine and run it whenever a new document is created from the
template or whenever a document based on that template is opened. (To do
that, see http://word.mvps.org/FAQs/MacrosVBA/DocumentEvents.htm.) However,
code that mucks with a user's normal.dot is not really a nice thing to do.
Make sure that your code checks the .Saved status of normal.dot and, if it
was .Saved, that your code Saves it.
However, this won't solve the problem if users emailing a document outside
your environment where the template (and its code) are not available.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> Is there a way to create custom captions in such a way that they
> "travel with" a Word template? I want to create these captions for an
[quoted text clipped - 8 lines]
>
> Kevin
Kevin - 17 Nov 2006 02:45 GMT
> Hi Kevin
>
[quoted text clipped - 57 lines]
> >
> > Kevin
Thanks for this, Shauna, and sorry for the imprecision in my language.
Question: Let's assume that we dont't want to "muck with normal.dot,"
but can expect users tol employ MYSPECIAL.dot, which we'll tuck away on
a departmental network drive: Can I write a tiny VB.net application
that I can distribute to my users that will modify MYSPECIAL.dot
*after* they've downloaded the template so that they don't have to
manually make the modification? Or Can a .dot actually call an exe? I
don't want busy users to do precise actions they're unfamliar with,
fail, and call for support.
Perhaps I'm still unclear on the concept, and I understand these
solutions all have security implications.
Kevin
Shauna Kelly - 17 Nov 2006 23:20 GMT
Hi Kevin
Can you tell us exactly what you want the user to be able to do? Eg:
- open an existing document that this user created that used a certain Label
and ... (and what, exactly?)
or
- open an existing document that someone else created that used a certain
Label and ... (and what, exactly?)
or
- create a new document and .... (what?)
And, for the sake of ease in communication, what's the name of the Label you
want to create?
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
>> Hi Kevin
>>
[quoted text clipped - 73 lines]
>
> Kevin