ChangeFileOpenDirectory reverts template???

T

tjmarques

Hi,

I'm having this bizarre problem with some of my documents:
I have two Word documents opened, Doc 1 and Doc2, both with attached
templates.
1. I change the attached template to Doc2 (UI or AttachedTemplate
property by code, the result is the same), setting the full path (not
default), not just the name.
2. I save Doc2.
3. On Doc1 (based on a precise template one, this doesn't happen for
all documents) I change de file open directory programatically
(ChangeFileOpenDirectory method)
--> Attached template to Doc2 doesn't change.
4. Close and re-open Doc2
--> Attached template to Doc2 reverts to what it was previously. If I
attach several templates in a row it always "remembers" the one before
the last one.

Does anyone have an explanation for this?
What could be happening?
Why is this only happening whem issuing the ChangeFileOpenDirectory
from documents (Doc1) based on this one exact template?
What should I search for in the code of this template that can be done
wrong?

Although I have quite some experience with VBA, I did not write most of
the code myself, so I really have no idea where to start searching. (I
was asked to add a macro that would attach a template to all files in a
folder, which I did looping all documents in the folder, opening,
setting the AttachedTemplate to the full path of the template file,
saving and closing, which should be pretty standard).

Thanks for any help you can give
Tiago
 

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