Custom formatting for TOC?

  • Thread starter Thread starter Harry
  • Start date Start date
H

Harry

I'm setting up a table of contents using styles, and I'd like to customize it
in a very specific way. Instead of having just the style text and page
number, e.g.:

Swine Flu test 4


I'd like to include an extra field at the beginning of each line:

46585 Swine Flu test 4

The first field isn't directly next to the second field--in fact, it's after
it, several lines down. I'd also like to enclose each field with a
border--not just each line, but each field within the line, i.e., like a
table grid.

We generate these docs each week, so I'm trying to find a way to automate
the setup for the table of contents to speed it up. If it requires a lot of
manual formatting it'll kind of defeat the purpose. Am I asking too much? Is
there a way to do this?

Thanks,
Harry
 
It isn't possible to do any of that with just the standard TOC field.

What can be done by writing a macro (as you say, "automated") is to take the
standard TOC after it's updated, change it to regular text, turn it into a
real table with borders, and move or copy the extra field from its current
position.

This would take some development by someone with knowledge of macro
programming in Word. In particular, the macro would have to be told some
fixed rule about how to find the information for each extra field.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
Thanks, Jay. How can I convert the TOC to text?

Jay Freedman said:
It isn't possible to do any of that with just the standard TOC field.

What can be done by writing a macro (as you say, "automated") is to take the
standard TOC after it's updated, change it to regular text, turn it into a
real table with borders, and move or copy the extra field from its current
position.

This would take some development by someone with knowledge of macro
programming in Word. In particular, the macro would have to be told some
fixed rule about how to find the information for each extra field.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.



.
 
Position the cursor anywhere within the TOC (which is a field) and
press Ctrl+Shift+F9 -- that's the keyboard shortcut for the
UnlinkFields command.

After you do that, the TOC is no longer a field, so it won't update if
anything changes elsewhere in the document. Unless you want to
manually patch up all the changes, including repagination, you'd have
to delete the entire modified TOC and start over. That's why a macro
becomes necessary.
 
Back
Top