Trouble sharing global addins

A

Alder

Hi all,

There's something very peculiar going on with the system of shared Word
templates I'm developing.

The "system":

INITWORKGROUP.DOT
Loaded by each user at Startup from a shared network folder, this template
runs an AutoExec macro to declare some global variables and define some
constants. It also contains two CommandBars: "SharedBar" and
"LetterOptions". The "SharedBar" is displayed at Word startup and contains
buttons to run short macros (stored in a standard module of this template)
to open new documents based on document templates. This CommandBar also has
buttons that run macros contained in a standard module of the template
described next. There are no References defined in this template's project.

SHAREDLIBRARY.DOT
Contains global variables and several VBA subs and functions used by the
document templates. A Reference to INITWORKGROUP.DOT is defined in this
template's project to make the variables defined by the previous template
available to modules in this project. The SHAREDLIBRARY.DOT file is not in
the Startup folder.

Document templates
Each contains a Reference to both INITWORKGROUP.DOT (for accessing its
variables) and SHAREDLIBRARY.DOT (for accessing its modules).


The "problem":
The system works when one user in the workgroup opens Word. When a second
user opens Word the "SharedBar" displays, but when one of its buttons is
clicked, the INITWORKGROUP.DOT template is loaded a second time. Each
subsequent button click loads a copy of INITWORKGROUP.DOT.

My design has a big mistake in it, but I don't see where it is. If anyone
has suggestions on how to properly design this system, I'd appreciate it.


Thanks,

Alder
 
J

Jonathan West

Hi Alder

Your problem is that the templates are being shared. Bad idea. Give each
user their own copy saved on their own hard disk. Word is not really
designed to cope with *anything* being shared.


--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
R

Rick Stebbins

The template references to INITWORKGROUP.DOT are causing
it to load again after it had already loaded during
Startup.

Try moving your shared variables and constants from
INITWORKGROUP.DOT into SHAREDLIBRARY.DOT, and just set a
reference to SHAREDLIBRARY.DOT. Then you can remove the
references to INITWORKGROUP.DOT from each template.

-----Original Message-----
Hi all,

There's something very peculiar going on with the system of shared Word
templates I'm developing.

The "system":

INITWORKGROUP.DOT
Loaded by each user at Startup from a shared network folder, this template
runs an AutoExec macro to declare some global variables and define some
constants. It also contains two CommandBars: "SharedBar" and
"LetterOptions". The "SharedBar" is displayed at Word startup and contains
buttons to run short macros (stored in a standard module of this template)
to open new documents based on document templates. This CommandBar also has
buttons that run macros contained in a standard module of the template
described next. There are no References defined in this template's project.

SHAREDLIBRARY.DOT
Contains global variables and several VBA subs and functions used by the
document templates. A Reference to INITWORKGROUP.DOT is defined in this
template's project to make the variables defined by the previous template
available to modules in this project. The
SHAREDLIBRARY.DOT file is not in
 
A

Alder

Thanks, Rick.

I'll give it a go.

Regards,
Alder

Rick Stebbins said:
The template references to INITWORKGROUP.DOT are causing
it to load again after it had already loaded during
Startup.

Yes, but only for the second and subsequent users.
 
A

Alder

Thanks, Jonathan.

It seems to have been a good idea for global templates with Autotext only,
but sharing anything else has indeed been a headache. Looks like individual
copies on each user's HDD is worth a try.

Cheers,
Alder
 
R

Rick Stebbins

Yes, local templates are the best solution. With shared
templates you'll have to deal with numerous issues such as
the following:

- Must get all users out of the templates in order to
deploy updates

- Possibility for documents to get 'Disk is Full' errors
when saving, due to missing references

- Document recipients may experience long delays (1-5 min)
opening your document if their workstation does not have
the template and if the document's template path uses
Universal Naming Conventions (UNC) rather than network
drive
 
A

Alder

Progress, and partial success!

After making the recommended changes the global templates are not reloaded
as they were before and users can create new documents by clicking on each
of the buttons on "SharedBar". THANK YOU!!!!

Alder
 
M

mksmith

All you have to do is to create a login script which copies the templates
from a central location to the user's hard drive.

This means that each time they log on they get the latest template. I
have found that this is the best way of distributing them.

Malc
www.dragondrop.com
 
A

Alder

Malc,

I appreciate the suggstion, because it's probably the best technically.
Unfortunately (or not, depending on your perspective :) ), I'm not a
system administrator and am in no position to have login scripts
modified, or even suggest they be modified.

In the end, I used Rick's comments to redesign this system of global
addins and document templates in a fashion that finally worked. So,
yes, Word is a difficult beast to share, but it is possible.

For the benefit of others who might find this thread useful, the end
product works like this:

1. All users share the same Word Startup folder and the same Workgroup
Templates folder.

2. The Word Startup folder contains three templates: two are devoted
exclusively to autotext (separated for managability purposes), and one
contains only an AutoExec macro. This AutoExec macro merely loads the
user's own customized template based on the username. This third
template contains an Object Library Reference to the template described
next.

3. The guts of the system reside in a template that contains several
shared resources:
- an AutoExec macro
- CommandBars common to all document templates:
1) "SharedBar" with buttons to launch all doc templates
2) "Letter Options" for adding cc lists, phrases, etc.
- Userforms common to all document templates (3)
- Public variables (defined with an AutoExec macro)
- Public Subs and Functions
- Autotext (that does not belong elsewhere - see above)

This template contains NO object library references to other
templates in this system.

The "SharedBar" CommandBar is visible at Word startup because
this template was saved with the toolbar visible, and because
of the object library reference to this template from the
template in #1. This same reference also ensures this
template is loaded globally at Word startup even though it
is not in the Word Startup folder.

4. The document templates, for the most part residing in the common
Workgroup Templates folder. Each of these contain an object library
reference to the template described in #3.

Thanks to everyone who helped me work it out.

Alder


(e-mail address removed) launched this projectile:
 
C

Chip Orange

I am very new at this, but this statement is difficult except given the
provision made for "workgroup" shared templates. Can you elaborate? Did
you mean your statement to apply to workgroup templates?

thanks.
 
M

Mark Tangard

Hi Chip,

This thread was about something that doesn't really relate to your
issue. I wouldn't try to glean much from it at your stage, except
to file away the axiom that it's better if a shared global template
is copied to each local PC at login rather than actually "shared."

A global template is different from a document template (although,
annoyingly, the file extension is the same [.dot]). When you hear
a mention of workgroup templates it's usually referring to document
templates, which *are* OK to share.
 
J

Jonathan West

Mark Tangard said:
Hi Chip,

This thread was about something that doesn't really relate to your
issue. I wouldn't try to glean much from it at your stage, except
to file away the axiom that it's better if a shared global template
is copied to each local PC at login rather than actually "shared."

A global template is different from a document template (although,
annoyingly, the file extension is the same [.dot]). When you hear
a mention of workgroup templates it's usually referring to document
templates, which *are* OK to share.

I would even recommend against sharing document templates. It is harder to
roll out new versions if the file is locked because somebody has left a
document a document open opvernight.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
J

Jonathan West

Chip Orange said:
I am very new at this, but this statement is difficult except given the
provision made for "workgroup" shared templates. Can you elaborate? Did
you mean your statement to apply to workgroup templates?

Generally I would recommend against using any templates from a shared
location.

The first and most obvious reason is that enough of an organisation's
activities will already grind to a halt if the network goes down, and there
is no justification for adding word-processing to that list. If all
templates are stored on individual's PC hard disks, at least letters can
continue to be written! (even if the network must come back up again before
they can be printed on network printers...)

The second reason is ease of updating. In a small organisation of just a few
PCs, it's not hard to copy files manually to each PC when a new version is
available. In a larger organisation, there are a variety of painless ways of
pushing out updates - using login scripts to copy files from a central
location, or using SBS to push out new versions. Large organisations usually
aleady have methods of this sort of thing already set up, to push out
security patches and other updates. Its a simple process to put out new
editions of Word templates by the same method. If a file in a shared
location is locked because somebody has left a document open overnight, it
can be harder to update shared files than local ones.

The third reason is the trouble that Alder has run into - i.e. unexpected
behaviour as a result of contention between users accessing the same
template. If you have to guard against that, your testing is made much more
complex and lengthy, and it restricts you in some things you can do with
VBA. Since the trouble is so easily avoided, there seems little purpose in
seeking it out!

While I accept that Word makes it *possible* to share templates, the
pitfalls and restrictions are such that I would always advise against making
use fo the feature.

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 
C

Chip Orange

thanks; I am indeed implementing a solution which is using global templates
(I have macros that need to be accessible regardless of the documents
template). I had planned to put a shortcut to the global template into the
Word startup dir (point to a networked location), but it sounds like you're
saying it's better to copy down the entire global template(s) at login
rather than using this approach?

thanks.

Chip

Mark Tangard said:
Hi Chip,

This thread was about something that doesn't really relate to your
issue. I wouldn't try to glean much from it at your stage, except
to file away the axiom that it's better if a shared global template
is copied to each local PC at login rather than actually "shared."

A global template is different from a document template (although,
annoyingly, the file extension is the same [.dot]). When you hear
a mention of workgroup templates it's usually referring to document
templates, which *are* OK to share.

--
Mark Tangard, Microsoft Word MVP
Please reply only to the newsgroup, not by private email.
Note well: MVPs do not work for Microsoft.
"Life is nothing if you're not obsessed." --John Waters


Chip said:
I am very new at this, but this statement is difficult except given the
provision made for "workgroup" shared templates. Can you elaborate? Did
you mean your statement to apply to workgroup templates?

thanks.

appreciate
it.
 
C

Chip Orange

thank you.

I agree with all your points; the only advantage to storing templates on a
shared location is that a "fix" to a problem is available immediately,
instead of making your user log out and back in again (hopefully though,
this doesn't happen to often to make a difference).

Chip
 
J

Jonathan West

Chip Orange said:
thank you.

I agree with all your points; the only advantage to storing templates on a
shared location is that a "fix" to a problem is available immediately,
instead of making your user log out and back in again (hopefully though,
this doesn't happen to often to make a difference).

To get access to an updateed template they would have to exit Word and
restart. The additional time involved in logging out & in again is not all
that significant, compared to the time spend *developing* the updated
template :)

--
Regards
Jonathan West - Word MVP
MultiLinker - Automated generation of hyperlinks in Word
Conversion to PDF & HTML
http://www.multilinker.com
 

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