Custom formatting for TOC?

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
 
J

Jay Freedman

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.
 
H

Harry

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.



.
 
J

Jay Freedman

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.
 

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

Similar Threads

TOC overlap 0
Numbering custom table of contents (TOC) 1
ToC Fields show 4
A Table within a TOC 1
TOC 2
Re: Multi-coloured text in TOC possible? 19
Individual TOC format 3
Word 2007 TOC for multiple docs...problem 1

Top