Word creates its own styles

G

gnorberg

When I try to close a document while the Styles and Formatting pane is open,
word crashes. This only seems to be happening with documents attached to
three custom templates I've written, but to none of the several others I have.

When I reopen the document after the crash, there are two new styles in the
pane. (i.e. the original style is "mybodytext." The two new styles are
"mybodytext char" and "mybodytext char char." One is a paragraph style; the
other is a character style). I have read countless reports in this
discussion group that say Word doesn't spontaneously create styles. We are
just mistaking formatting for styles. Sorry, but these are not formatting.
I have the pane set up not to show formatting. Also, when I do a Find and
Replace on the rogue styles, they are found and replaced. If I simply close
and then reopen a document the rogue styles do not reappear. They only come
back when word crashes as described above.

How do I keep Word from crashing like this?
 
K

Klaus Linke

Hi,

Are you sure that Word crashes only when the Styles and Formatting pane is
open?

One thing I'd check: Does the problematic template specify the save format
(Tools > Options > Save) to be something else but the current Word *.doc
format? Or does the template have any other code related to saving?

If you've read up on the char and char char styles, you probably know that
they are likely present in your doc anyway.
They are just cleverly hidden from view in (patched) versions 2002 and
above.

Microsoft moves toward mostly doing away with the difference between
paragraph styles and character styles. In the future, you'll be able to
apply "Body Text" to some "Heading 1" paragraph, or the other way round.
Behind the scenes, what is applied is a "Body Text Char" character style,
but you never get to see that. "Body Text" and "Body Text Char" are treaded
as a single "linked" style.
Bugs in the design of that feature led to "Char Char [...]" styles being
created, and other bugs. Most of these bugs seem to be fixed if you have
installed all the available Service packs, but the styles themselves may
still be hidden in older docs or templates.
And those invisible styles do appear visibly when you save in older formats,
or work on the documents in older versions of Word (say 2000).
So it seems likely that your crashing template must save in an older format.
It doesn't sound terribly likely to me that the crashes have a direct
connection to the char styles. If you want you can mail one of the
problematic custom templates to (e-mail address removed) and I'll check a bit
into it.

Greetings,
Klaus
 
G

gnorberg

Thanks for getting back to me on a holiday weekend, Klaus.

There have been other occasions when Word has crashed on me, but only
rarely. In this case, it crashes every single time I try to close a document
using any one of three templates I designed while the Styles and Formatting
pane is open. If the pane isn't open, Word doesn't crash. Please note that
I have had two of these templates for years and the problem only started a
few days ago after I built the third template (which was working fine for a
while).

I checked on the Save Format for the template. It's a little confusing when
it comes to templates. On one hand I'm thinking it should save as .doc
because that's what the template will tell its documents to do. On the other
hand, shouldn't it be .dot since the file itself is a template? Hmm.
Anyway, no, the setting for the template and all documents is word document
(.doc). And the files I'm working with right now were all created using Word
2002.

One thing I did do is uncheck the box called "Embed Linguistic Data" since I
don't need it. I then saved the template and reopened it (several times).
Guess what? "Embed Linguistic Data" rechecks itself. Hmm.

My version of Word is Microsoft Word 2002 (10.2627.2625) I think I'm up to
date with service packs, but this cryptic identifier doesn't really tell me.

Thank you so much for the offer to look over my template. Yes, I will send
you a copy right away.



Klaus Linke said:
Hi,

Are you sure that Word crashes only when the Styles and Formatting pane is
open?

One thing I'd check: Does the problematic template specify the save format
(Tools > Options > Save) to be something else but the current Word *.doc
format? Or does the template have any other code related to saving?

If you've read up on the char and char char styles, you probably know that
they are likely present in your doc anyway.
They are just cleverly hidden from view in (patched) versions 2002 and
above.

Microsoft moves toward mostly doing away with the difference between
paragraph styles and character styles. In the future, you'll be able to
apply "Body Text" to some "Heading 1" paragraph, or the other way round.
Behind the scenes, what is applied is a "Body Text Char" character style,
but you never get to see that. "Body Text" and "Body Text Char" are treaded
as a single "linked" style.
Bugs in the design of that feature led to "Char Char [...]" styles being
created, and other bugs. Most of these bugs seem to be fixed if you have
installed all the available Service packs, but the styles themselves may
still be hidden in older docs or templates.
And those invisible styles do appear visibly when you save in older formats,
or work on the documents in older versions of Word (say 2000).
So it seems likely that your crashing template must save in an older format.
It doesn't sound terribly likely to me that the crashes have a direct
connection to the char styles. If you want you can mail one of the
problematic custom templates to (e-mail address removed) and I'll check a bit
into it.

Greetings,
Klaus






When I try to close a document while the Styles and Formatting pane is
open,
word crashes. This only seems to be happening with documents attached to
three custom templates I've written, but to none of the several others I
have.

When I reopen the document after the crash, there are two new styles in
the
pane. (i.e. the original style is "mybodytext." The two new styles are
"mybodytext char" and "mybodytext char char." One is a paragraph style;
the
other is a character style). I have read countless reports in this
discussion group that say Word doesn't spontaneously create styles. We
are
just mistaking formatting for styles. Sorry, but these are not
formatting.
I have the pane set up not to show formatting. Also, when I do a Find and
Replace on the rogue styles, they are found and replaced. If I simply
close
and then reopen a document the rogue styles do not reappear. They only
come
back when word crashes as described above.

How do I keep Word from crashing like this?
 
K

Klaus Linke

Thanks for getting back to me on a holiday weekend, Klaus.

It isn't here... anymore.
Last Thursday was a holiday, and many people took Friday off.

I haven't been able to reproduce the crashes.
On a first glance: Do the crashes go away if you uncheck "Tools > Templates
and add-ins > Automatically update document styles"?
Or do they go away when you have started Word in "safe mode" (hold Ctrl as
you start Word)?

Greetings,
Klaus
 
G

gnorberg

I'm afraid continues crashing even after I uncheck "Automatically update
document styles." The problem also persists when I run Word in safe mode.
 
K

Klaus Linke

I'm afraid continues crashing even after I uncheck "Automatically update
document styles." The problem also persists when I run Word in safe mode.


Good! That eliminates lots of possibilities, and suggests that your guess
about the Char styles being the problem might be right on the money.
I don't have Word2002 any more, and can only test in Word2003 (which doesn't
crash).

Maybe you could try to clean up the unused styles and Char styles. I have
posted a macro to delete unused styles here:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Cat=&Board=wrd&Number=571423

It asks you whether you want to keep an unused style. I'd get rid of the
Char styles first, and see if that solves the problem.
If that isn't the case, post back. It might be something about the bulleted
styles.

You could also try some general-purpose remedies in cases when Word acts up,
such as described here:
http://www.wopr.com/cgi-bin/w3t/showthreaded.pl?Number=197827
(... we eliminated point 2 already), and make sure you have the latest
updates (from Word's Help menu).

Regards,
Klaus
 
G

gnorberg

Klaus,

I can't thank you enough for your help with this problem. I recently rolled
back my system to a previous incarnation and apparently lost Service Pack 3
in the process. Today I downloaded it and, fingers crossed, the problem with
crashes appears to be solved! Your reminder is what prompted me to check out
the updates. You're a lifesaver (my favorite is lime).

I would still like to delete any unused styles and used the link you sent to
find your macro. I found the attachment that contains the macro, but here
is where I must confess ignorance. I can't figure out how to download the
macro or run it. Can you help a bozo?
 
K

Klaus Linke

You're a lifesaver (my favorite is lime).

Heh heh... It's a little-known fact that the tin-foil hats MVPs are wearing
are actually made from the wrapping.

To get the macro going, you paste it into a module of your normal.dot.
The article here takes you through the moves:
http://word.mvps.org/FAQs/MacrosVBA/CreateAMacro.htm

Regards,
Klaus
 

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