Reference Woes

W

Wraithchilde

I work with several hundred different templates, most of which reference
other templates and use the VBA code in them. Lately, I believe after the
coporate office suite upgrade, I'm having problems with these references when
I edit a template.

If I go into the VBA editor and click tools, references, I'll see something
like:
~WRD1955.tmp

I know this is a temp file that word uses for god only knows, but how did it
get into the references? And why can't I point it back to right reference?
Does anyone have any suggestions or know where I might get info on this?
 
J

Julie

Here's one way this happens,

Background: If after your upgrade your referenCED file is in a different
folder than before, the referencING files will still find it IF the
referenCED file is loaded as an addin. In that circumstance, the Word
adjusts the reference to point to the temporary file. So far so good. It's
a handy feature that I use to allow my systems run in normal mode (C drive)
and also run in terminal services mode (e.g. G: drive). Because of the way
Word substitutes the references, we can get a way with using direct
referencing among VBA projects yet still have the system installed on a
different drive without maintaining 2 versions.

The problem: IF you edit a referencING template when the reference is
pointing to a TEMP file, then that save is permanent and, of course, the
reference doesn't work properly the next time Word starts. (And it goes
without saying that if you rely on Word to adjust the references as above,
there must be structures in place to ensure users at large cannot edit the
referencING templates!).

If that is what happened to you, you must reset your references in the
referencING projects from the VBA editor, either as and when those projects
come up for edit, or (best) get them all done part of your "conversion
tasks".

Hopefully is helpful for you.
 
W

Wraithchilde

Actually it turns out I was a little premature in thinking my problem was
solved. It all sounded so good. But no matter what I do it still saves a temp
file reference. If I have it loaded and check it, even though I see the full
path, it saves the ref to the temp file. If I don't have it loaded and type
in the full name with the path it saves the ref to the temp file. If change
references programatically with the string being the full path to the real
ref it still saves the ref to the temp file. It appears now there is no way
to fix it.
 
J

Julie

Not sure I'm following you ... It sounds to me like you may be getting
burned by Word automatically saving the addins because Word sees them as
"dirty". If it helps shed some light for you, I'll explain more about what
I do in this connection. Mabye something here will jump out as a possible
solution,

1. in my environments I don't set the references programmatically. They
are set only at design time. The VBA projects are password protected.

2. There is automation and measures in place to prevent Word from
automatically saving the referencED and referencING files as a result of
Word seeing them as "dirty". Importantly, the "saved" property of the files
is always set to "true" after load so that word doesn't see them as "dirty".
Because some of my document templates are referencING templates, there is
also a universal procedure that runs on document closing that sets the saved
property of the relevant attached templates to true to force Word to discard
the change. All relevant DOT files are also flagged as read-only at the
file level.

With those measures in place, I find that the only time a project gets saved
with a reference pointing to a temporary file is when a developer is not
paying attention and accidentally does so. With approximately 3,000 users
affected, I have never seen the scheme fail except as to developer error.

When you do get a temporary file reference Word can be a little
argumentative about removing it. As noted, it takes at least two trips to
the Tools - References dialogue in VBA - one to remove the reference to the
temporary file, and one to reset the proper reference. If I recall, there
was also a version of Word that seemed to want the file to be saved after
removing the temporary reference, before adding the real reference.

Hopefully there is something here that helps you. J.
 

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