Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

Reference Woes

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Wraithchilde - 15 Nov 2006 19:22 GMT
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?
Julie - 20 Nov 2006 16:07 GMT
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.

>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
[quoted text clipped - 11 lines]
> 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?
Wraithchilde - 22 Nov 2006 18:48 GMT
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.
Julie - 24 Nov 2006 20:10 GMT
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.

> 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
[quoted text clipped - 9 lines]
> way
> to fix it.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.