Thread: A custom TOC
View Single Post
  #2   Report Post  
Shauna Kelly
 
Posts: n/a
Default

Hi Paul

Your real problem appears to be with the tabs. Are you modifying the TOC 1
style, or are you modifying the TOC itself once its created? If you change
the formatting of the TOC directly, your changes won't survive the updating
of the TOC. You have to modify the TOC 1 style itself.

Try modifying the TOC 1 style to have a left-aligned tab at 3cm and a
right-aligned tab at 15cm and a hanging indent of 3cm. Change the 15cm tab
as required to position your page numbers against the right margin. If you
need to adjust the 3cm tab, make sure you change the hanging indent as well.
They must match for all to work perfectly.

You then won't need the @ and replace solution. Just do { TC
ABSReturn.... } where is a Tab.

Hope this helps.

Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word


"Paul Terrano" wrote in message
...
I posted the following question in August 2003 and received no
responses. I'm hoping for better luck now.

I am preparing documentation for a program that uses a large
number of functions to manipulate stock prices. This volume
contains one or at most two pages to describe each function and
they are arranged in alphabetical order. There are about 240 of
these functions and I wanted the TOC to look like this:



ABS Return the absolute value of a number
3

ACCDISTR Calculate the Accumulation/Distribution indicator
4

ASCII Return a string containing a character specified by a
value 22



BDAYS Returns the number of business days between two dates
23



and so forth.



This example was keyed in by hand to avoid a text conversion from
Word. The space between the end of the description and the page
number includes the usual dot leader.



The descriptive phrases shown do not appear in the underlying
documentation, so the techniques for using manual line breaks or
unusual formatting do not apply as far as I am able to determine.
TC fields appeared to have some hope and I created entries like
{TC "ABSReturn the absolute value of a number"}. {} was produced
by Ctrl+F9 and represents the tab symbol. I was unable to
format the tab, so the comments did not line up. There are some
indications in the numerous articles and news entries that I read
that this may be a bug in Word 2000.



I then used a scheme described by McGhie and others where the TC
entry is entered as {TC "ABS@Return the absolute value of a
number"} while the first entry when the initial letter changes
is coded as {TC "@@BDAYS@Returns the number of business days
between two dates"}. After the toc is created, @@ is replaced by
a hard return and @ is replaced by a tab.



This scheme works tolerably well, but specifying a tab to be 1.0"
using Format|Tabs|Set doesn't stick. Usually the tab replacement
step results in a dotted leader appearing between the function
name and the description as well as between the description and
the page number, but resetting the tab with Format|Tabs|Set fixes
the toc spacing and the tab and leader between the description
and page number is unaffected. Each TC field is on the same page
as the function so that Word is able to create the correct page
number. The default TOC1 style is used to produce the table of
contents. I do not anticipate a great deal of maintenance, so I
am considering a completely hand-built toc.



Although I am pretty happy with the @ scheme, Pride Goeth Before
a Fall, so I would appreciate some analysis and suggestions from
the knowledgable contributors to this newsgroup. I have only
created a few entries so that not much work will be lost if a
superior alternative surfaces.