Hi Group

I'm in the process of building a bunch of templates for various use
(report, fax, memo...). Once finished, the templates will be distributed
through local network shares to my co-workers.

Now the different templates have many things that they have in common
(e.g. phone number, address etc.), which I would like to store in a
central place. Also, I'd need some macros in all of the templates, which
I would like to store in a central place, too.

I have thought about using a reference in C:\Documents and
Settings\...\Application Data\Microsoft\Word\STARTUP that points to a
resource .dot file on the network. That file can now hold all the stuff
that needs to be centralized.

So far the resource template gets properly loaded on startup of word,
but I'm unable (or don't know how) to access the information within
(through VBA code in the document template, say on document_new). So,
these are my questions:

1) Is this whole stuff a good idea or should I drop it and "hard-code"
the information into each template?

2) How can I access those classes from within the document template's
VBA code?

Any help greatly appreciated!

Thx,
Bernhard

Re: Load and Use Classes from another template by Jean-Guy

Jean-Guy
Tue May 10 09:50:44 CDT 2005

Bernhard Mäder was telling us:
Bernhard Mäder nous racontait que :

> Hi Group
>
> I'm in the process of building a bunch of templates for various use
> (report, fax, memo...). Once finished, the templates will be
> distributed through local network shares to my co-workers.
>
> Now the different templates have many things that they have in common
> (e.g. phone number, address etc.), which I would like to store in a
> central place. Also, I'd need some macros in all of the templates,
> which I would like to store in a central place, too.
>
> I have thought about using a reference in C:\Documents and
> Settings\...\Application Data\Microsoft\Word\STARTUP that points to a
> resource .dot file on the network. That file can now hold all the
> stuff that needs to be centralized.
>
> So far the resource template gets properly loaded on startup of word,
> but I'm unable (or don't know how) to access the information within
> (through VBA code in the document template, say on document_new). So,
> these are my questions:
>
> 1) Is this whole stuff a good idea or should I drop it and "hard-code"
> the information into each template?

Yes, that is the way to go.
Put the data in AutoText in the global template and all users loading the
global templates will have access to those Autotext entries.
The same with toolbars and associated macros.

> 2) How can I access those classes from within the document template's
> VBA code?

Open a template, in the VBA editor, go to Tools > References... and set a
reference to the global template project. Then you will be able to call all
the public macros in the global template by using Intellisense (Type the
global project name, then a "." and you will get a list of all the available
modules, choose a module and type another "." to get the list of available
macros in the module).

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org




Re: Load and Use Classes from another template by nonuschk

nonuschk
Wed May 11 03:16:27 CDT 2005

Jean-Guy Marcil wrote:
> Bernhard Mäder was telling us:
> Bernhard Mäder nous racontait que :
>
>
>>Hi Group
>>
>>I'm in the process of building a bunch of templates for various use
>>(report, fax, memo...). Once finished, the templates will be
>>distributed through local network shares to my co-workers.
>>
>>Now the different templates have many things that they have in common
>>(e.g. phone number, address etc.), which I would like to store in a
>>central place. Also, I'd need some macros in all of the templates,
>>which I would like to store in a central place, too.
>>
>>I have thought about using a reference in C:\Documents and
>>Settings\...\Application Data\Microsoft\Word\STARTUP that points to a
>>resource .dot file on the network. That file can now hold all the
>>stuff that needs to be centralized.
>>
>>So far the resource template gets properly loaded on startup of word,
>>but I'm unable (or don't know how) to access the information within
>>(through VBA code in the document template, say on document_new). So,
>>these are my questions:
>>
>>1) Is this whole stuff a good idea or should I drop it and "hard-code"
>>the information into each template?
>
>
> Yes, that is the way to go.
> Put the data in AutoText in the global template and all users loading the
> global templates will have access to those Autotext entries.
> The same with toolbars and associated macros.
>
>
>>2) How can I access those classes from within the document template's
>>VBA code?
>
>
> Open a template, in the VBA editor, go to Tools > References... and set a
> reference to the global template project. Then you will be able to call all
> the public macros in the global template by using Intellisense (Type the
> global project name, then a "." and you will get a list of all the available
> modules, choose a module and type another "." to get the list of available
> macros in the module).
>


Aah, yes, thank you!

I'm still not sure if this is going to be good, though. Since this
either requires the user to have access to the network every time the
VBA accesses the resources, or copy the resource file to his local
machine, which makes updating difficult.

Thanks,
Bernhard

Re: Load and Use Classes from another template by Jean-Guy

Jean-Guy
Wed May 11 09:01:40 CDT 2005

Bernhard Mäder was telling us:
Bernhard Mäder nous racontait que :

> Jean-Guy Marcil wrote:
>> Bernhard Mäder was telling us:
>> Bernhard Mäder nous racontait que :
>>
>>
>>> Hi Group
>>>
>>> I'm in the process of building a bunch of templates for various use
>>> (report, fax, memo...). Once finished, the templates will be
>>> distributed through local network shares to my co-workers.
>>>
>>> Now the different templates have many things that they have in
>>> common (e.g. phone number, address etc.), which I would like to
>>> store in a central place. Also, I'd need some macros in all of the
>>> templates, which I would like to store in a central place, too.
>>>
>>> I have thought about using a reference in C:\Documents and
>>> Settings\...\Application Data\Microsoft\Word\STARTUP that points to
>>> a resource .dot file on the network. That file can now hold all the
>>> stuff that needs to be centralized.
>>>
>>> So far the resource template gets properly loaded on startup of
>>> word, but I'm unable (or don't know how) to access the information
>>> within (through VBA code in the document template, say on
>>> document_new). So, these are my questions:
>>>
>>> 1) Is this whole stuff a good idea or should I drop it and
>>> "hard-code" the information into each template?
>>
>>
>> Yes, that is the way to go.
>> Put the data in AutoText in the global template and all users
>> loading the global templates will have access to those Autotext
>> entries. The same with toolbars and associated macros.
>>
>>
>>> 2) How can I access those classes from within the document
>>> template's VBA code?
>>
>>
>> Open a template, in the VBA editor, go to Tools > References... and
>> set a reference to the global template project. Then you will be
>> able to call all the public macros in the global template by using
>> Intellisense (Type the global project name, then a "." and you will
>> get a list of all the available modules, choose a module and type
>> another "." to get the list of available macros in the module).
>>
>
>
> Aah, yes, thank you!
>
> I'm still not sure if this is going to be good, though. Since this
> either requires the user to have access to the network every time the
> VBA accesses the resources, or copy the resource file to his local
> machine, which makes updating difficult.

You can have a simple script that runs when a user logs on to the network.
The script checks whether the local global template has a modified date
that is older than the one on the network, if so, it gets updated.

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org




Re: Load and Use Classes from another template by nonuschk

nonuschk
Thu May 12 02:27:19 CDT 2005

Jean-Guy Marcil wrote:
> Bernhard Mäder was telling us:
> Bernhard Mäder nous racontait que :
>
>
>>Jean-Guy Marcil wrote:
>>
>>>Bernhard Mäder was telling us:
>>>Bernhard Mäder nous racontait que :
>>>
>>>
>>>
>>>>Hi Group
>>>>
>>>>I'm in the process of building a bunch of templates for various use
>>>>(report, fax, memo...). Once finished, the templates will be
>>>>distributed through local network shares to my co-workers.
>>>>
>>>>Now the different templates have many things that they have in
>>>>common (e.g. phone number, address etc.), which I would like to
>>>>store in a central place. Also, I'd need some macros in all of the
>>>>templates, which I would like to store in a central place, too.
>>>>
>>>>I have thought about using a reference in C:\Documents and
>>>>Settings\...\Application Data\Microsoft\Word\STARTUP that points to
>>>>a resource .dot file on the network. That file can now hold all the
>>>>stuff that needs to be centralized.
>>>>
>>>>So far the resource template gets properly loaded on startup of
>>>>word, but I'm unable (or don't know how) to access the information
>>>>within (through VBA code in the document template, say on
>>>>document_new). So, these are my questions:
>>>>
>>>>1) Is this whole stuff a good idea or should I drop it and
>>>>"hard-code" the information into each template?
>>>
>>>
>>>Yes, that is the way to go.
>>>Put the data in AutoText in the global template and all users
>>>loading the global templates will have access to those Autotext
>>>entries. The same with toolbars and associated macros.
>>>
>>>
>>>
>>>>2) How can I access those classes from within the document
>>>>template's VBA code?
>>>
>>>
>>>Open a template, in the VBA editor, go to Tools > References... and
>>>set a reference to the global template project. Then you will be
>>>able to call all the public macros in the global template by using
>>>Intellisense (Type the global project name, then a "." and you will
>>>get a list of all the available modules, choose a module and type
>>>another "." to get the list of available macros in the module).
>>>
>>
>>
>>Aah, yes, thank you!
>>
>>I'm still not sure if this is going to be good, though. Since this
>>either requires the user to have access to the network every time the
>>VBA accesses the resources, or copy the resource file to his local
>>machine, which makes updating difficult.
>
>
> You can have a simple script that runs when a user logs on to the network.
> The script checks whether the local global template has a modified date
> that is older than the one on the network, if so, it gets updated.
>

Yes, that might be the best solution, thanks for the hint!

Bernhard