TOC \p

R

Rix

I am trying to careate a Table of Contents with the page
number right after the entry (not in the right column)

WHAT I GET
Contents

Boy meets girl 1
Boy falls in love 7
Boy looses girl 12
Boy gives up 15

ONLY ONE SPACE BETWEEN HEADING AND NUMBER, I WANT MORE

WHAT I WANT
Contents

Boy meets girl 1
Boy falls in love 7
Boy looses girl 12
Boy gives up 15



the \p option will allow me to change only the FIRST char.

Example: TOC \p "xyz" gives me

Boy meets girlx1
Boy falls in lovex7
Boy looses girlx12
Boy gives upx15

I am running:
WS Word 2000 (9.0.2720)
from help:

Field codes: TOC (Table of Contents) field
{ TOC [Switches ] }

\p "Separators" Specifies the characters that separate an
entry and its page number. For example, the field
{ TOC \p "---" } displays a result such as "Selecting Text-
--53." The default is a tab with leader dots. You can use
up to five characters, which must be enclosed in quotation
marks.
 
S

Shauna Kelly

Hi Rix

I don't know of anyone who has ever found that the \p switch works as
advertised (http://www.mvps.org/word/FAQs/Formatting/TOCSwitches.htm).

You could, however, fake it. Set up your headings as follows:

Boy meets girlFAKE
Girl falls in loveFAKE
Boy loses interest and wanders away to the footballFAKE
Girl gives upFAKE

In each case, select the "FAKE" text, and format it in white (so you
can't see it). A TOC retains direct formatting. It thus retains the
white colour applied to the text, and gives you the appearance of space
before the page number. Choose text that will give you the amount of
horizontal space you need.

At Tools > Options > View, if you set field shading to Always, you'll be
able to see the effect of the "FAKE" text on the ToC field. It may also
be wise to work with Word displaying paragraph marks (click the ¶ button
on the toolbar). This will then display your heading as "Girl falls in
love ¶", which will remind you that there's fake, white text
between "love" and the end of the line.

If you've got a big document, and you'll be working with it over a
period of time, I would recommend creating a character style called,
say, FakeText. Define it as white text and apply it to the "FAKE"
characters. Then, if you need to edit your headings, or inspect them to
see what you're doing, you can just change the character style to
another colour, and it will change all your "FAKE" text in the document,
so you will be able to see it.

It's not a pretty or elegant solution, but I think it will work.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
Melbourne, Australia
 
Top