having a TOC use other than TOC 1 as style

C

Chip Orange

We have an application, with a template, which needs to cause an automatic
update of styles within documents made from it, each time one is opened.
We've found how to do this, and that part is working ok, and it allows us to
add new styles, or fix problems with existing ones, and have that happen
automatically for our users.

What we've encountered is one particular user who needs a different
formatting other than what TOC 1 gives her. If she modifies it in her
document, then it's overwritten the next time she opens it.

We'd like to know is it possible to create a TOC which would use something
other than TOC 1 as the style for formatting the contents of the TOC? I
don't mean with direct formatting, as that seems to be lost whenever she
updates the TOC field.

I have a VBA way around this, but I'd like to know just for my own sake and
future uses.

Thanks for any suggestions.


Chip
 
S

Suzanne S. Barnhill

If the TOC 1 style has been modified, it should not be overwritten unless
"Automatically update document styles" is checked for the template in Tools
| Templates and Add-ins.
 
R

Robert M. Franz (RMF)

Hello Chip

Chip said:
We have an application, with a template, which needs to cause an automatic
update of styles within documents made from it, each time one is opened.
We've found how to do this, and that part is working ok, and it allows us to
add new styles, or fix problems with existing ones, and have that happen
automatically for our users.

If you do that via Tools | Templates and Add-ins: While this is pretty
drastic, I would imagine that many longdocument-supporters will envy
you! :)

What we've encountered is one particular user who needs a different
formatting other than what TOC 1 gives her. If she modifies it in her
document, then it's overwritten the next time she opens it.

We'd like to know is it possible to create a TOC which would use something
other than TOC 1 as the style for formatting the contents of the TOC? I
don't mean with direct formatting, as that seems to be lost whenever she
updates the TOC field.

I have a VBA way around this, but I'd like to know just for my own sake and
future uses.

If it helps: you can build a TOC that uses, say, TOC 9 instead of TOC 1
for level-1 entries, yes. Observe the TOC switches (IIRC is that "\t").

HTH
Robert
 
C

Chip Orange

Yes, it is; unfortunately, we need that because we do need either to
introduce additional styles to everyone upon demand, or, to sometimes to
correct a problem with a xstyle.

This was working fine until we found a group of users who insisted on using
TC fields with *extremely* long descriptions, that stretched over many
lines, so they needed a blank line between each TOC entry to better set it
off. Everyone else uses short TC fields.

This is all in an environment where production of large, complex documents,
with data pulled from databases as well as other documents, is expected to
be automated by us (the IT folks), so that no one has to become a real Word
expert (I just can't tell them to learn how to deal with it in other words).

I'm going to store a document variable indicating a user's preference for
blank lines between each TOC entry, and I'm going to modify TOC1 style on
the fly upon document opening, unless I can find a better way.

Thanks for your help,

Chip
 
C

Chip Orange

Thanks Robert.

When I first read of the "\t" switch, I too thought it would do what you
described (and my experiments failed to verify this). Further reading leads
me to believe that it works in the reverse direction; that is, the named
style, when a TOC is built from styles, is used to indicate a level 1 TOC
entry, not that a level 1 TOC entry is formatted with that style.

Please correct me if you're really sure I've got it wrong way round, and
I'll have another go at it.

Thanks.

Chip
 
C

Chip Orange

Yes, thank you for trying to help, but that's not exactly the problem. I'm
not building the TOC from styles, but from TC fields; therefore, I'm stuck
using the standard TOC1 through TOC9 styles (as far as I know). Associating
TOC9 with the Heading1 style therefore won't help me.

I was hoping for a switch that would say, in effect, use this instead of
TOC1 for level 1. As you point out, the "\t" switch would do this if I were
using styles to form my TOC, but I'm not. (I believe the method you
describe is a way to automate the use of the "\t" switch isn't it?).

What I've done for now is to use a document variable to store user
preferences, and then modify TOC1 using AutoOpen() based on user
preferences. Works alright for now, but just checking on my understanding
of TOCs in Word.

Thanks again,

Chip
 
S

Suzanne S. Barnhill

What you want is not the \t switch in the TOC but the \l switch in the TC
field:

\l Level
The level of the TC entry. For example, the field { TC "Entering Data" \l
4 } marks a level-4 entry, and Microsoft Word applies the built-in style TOC
4 to that entry in the table of contents. If no level is specified, level 1
is assumed.
 
C

Chip Orange

Yes, thanks; that would work quite well.

Chip


Suzanne S. Barnhill said:
What you want is not the \t switch in the TOC but the \l switch in the TC
field:

\l Level
The level of the TC entry. For example, the field { TC "Entering Data" \l
4 } marks a level-4 entry, and Microsoft Word applies the built-in style TOC
4 to that entry in the table of contents. If no level is specified, level 1
is assumed.



need
 

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