Subdocuments.AddFromFile behavior

R

Rick Martin

I have created a set of macros that use the master/subdocument functions to
create and manage multi-chapter documents. These have worked fine (with minor
modifications) since Word 97. As suggested in the subject line, I use the
Subdocuments.AddFromFile method to insert subdocs into the master document.

Because, the individual chapters use a different template than the master
document, the user normally gets a message box notifying her of this fact
(answer OK). Also, because the two templates have the same set of styles,
another message box is displayed asking whether the styles of the subdocument
should be renamed. I tell my users to answer "No to All" so that the styles
from the master document are used throughout.

This functionality has worked consistently until some of my users upgraded
to Office 2003. Now, when they insert a new chapter (subdocument) file, these
message boxes do not appear, and the styles from the subdocument are renamed,
resulting in multiple versions of the same style in the document.

The odd thing is that I also use Word 2003, and, on my machine, the macro
functions as it always did. I cannot see any obvious differences in the Word
settings between my machine and the others.

Does anyone know what might control this behavior, either within Word or in
the VBA environment? Any suggestions as to how I can make sure styles in a
subdocument are not renamed?

Tanks.

Rick Martin
 
C

Charles Kenyon

Sorry, I don't have an answer because I don't use Master Documents. However,
you may need the reason I don't more than you need an answer. "Master
Document" is a term of art in Word referring to a "feature" that not only
doesn't work but also destroys documents. The consensus (with the limited
exception of Steve Hudson) among those offering advice on these newsgroups
is that using the Master Document feature is a good way to destroy your
document. It can destroy parts of your document that you are not even
working on! I think John McGhie said it succinctly when he said that there
are two kinds of Master Documents: Those that are corrupt and those that
will be corrupt soon. See
http://www.addbalance.com/word/masterdocuments.htm for information on the
Master Document feature and workarounds. See
http://www.mvps.org/word/FAQs/General/WhyMasterDocsCorrupt.htm for more
information on what goes wrong, and
http://www.mvps.org/word/FAQs/General/RecoverMasterDocs.htm for ideas on how
to salvage what you can. See
http://www.techwr-l.com/techwhirl/magazine/technical/masterdocs.doc for
Steve Hudson's instructions if you are willing to follow them very
carefully.

You may already be aware of these issues and be dealing with them, just
thought you should know.

--

Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
R

Rick Martin

Charles:

Seems you give this same reply to every question about master/subdocuments.
Which makes it not very useful.

As you can see from my message, I have been using this function for many
years. Yes, there are some problems, but by following Steve Hudson's famous
rules for using master documents, wrapping everything in my own macros to
control what happens, and working very carefully, I have been able to make
them work reasonably well.

What I would like is a real answer to this technical question, which has
nothing to do with the potentially file-corrupting habits of master/sub
documents.

Cheers.

Rick
 
C

Charles Kenyon

Hi Rick,

You are right that it is a standard answer. Many people, though, find it
very helpful. I'm glad you have a handle on it.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide


--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 

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