L
Laura
Does anyone know how to use VBA to write a windows registry key that tells
Word where a global template is located?
My Problem:
I have several workgroup templates that contain references to one global
template which contains a ton of code I use again and again from my workgroup
templates.
As I create the templates, I use "Tools, References" to set the references.
At that point I am logged in as myself and my global template is in the
default word startup folder (in the user profile).
(I want to keep the folder in the default location so I am not affecting
other people who may also be programming for Word and expect to put their
templates there.)
WHAT IS HAPPENING: Several different people may log onto any given computer.
As they do, a login script copies their templates into place for them. WHEN
THIS HAPPENS, sometimes my reference gets broken. It seems it is not looking
to the current startup folder for the global template -- rather it looks to
the other person's location. Internet research tells me when Word looks for
referenced, it looks in a location listed in a registry key for that template
first.
I tried using vba to look for broken refs and fix them, but this isn't
working because my templates crash with a "can't find project or library"
compile error due to other code in them, before they can even run the "fix
references" code.
I BELIEVE the problem is that the windows registry key for the global
templates is still listing the template in the previous users profile and it
is either an old version of the template, or not in a "trusted" location and
won't load due to macro security.
If I could run a line of code in an autoopen macro in my global template
that sets that windows registry key to the current users Word startup
directory I THINK that would fix the problem. But I have no idea what they
key is or how to write to the registry.
Sorry so long! Please help...!!!!
Word where a global template is located?
My Problem:
I have several workgroup templates that contain references to one global
template which contains a ton of code I use again and again from my workgroup
templates.
As I create the templates, I use "Tools, References" to set the references.
At that point I am logged in as myself and my global template is in the
default word startup folder (in the user profile).
(I want to keep the folder in the default location so I am not affecting
other people who may also be programming for Word and expect to put their
templates there.)
WHAT IS HAPPENING: Several different people may log onto any given computer.
As they do, a login script copies their templates into place for them. WHEN
THIS HAPPENS, sometimes my reference gets broken. It seems it is not looking
to the current startup folder for the global template -- rather it looks to
the other person's location. Internet research tells me when Word looks for
referenced, it looks in a location listed in a registry key for that template
first.
I tried using vba to look for broken refs and fix them, but this isn't
working because my templates crash with a "can't find project or library"
compile error due to other code in them, before they can even run the "fix
references" code.
I BELIEVE the problem is that the windows registry key for the global
templates is still listing the template in the previous users profile and it
is either an old version of the template, or not in a "trusted" location and
won't load due to macro security.
If I could run a line of code in an autoopen macro in my global template
that sets that windows registry key to the current users Word startup
directory I THINK that would fix the problem. But I have no idea what they
key is or how to write to the registry.
Sorry so long! Please help...!!!!