Hi =?Utf-8?B?VEpBQw==?=,
Is it possible, if you are creating a directory in Word, can you add
dictionary type headings automatically? Can Word pick up the first letter of
the first listing on the page and the first letter of the last listing of the
page and add it to the top?
It can be done, but setting it up will take some time. Word has the StyleRef
field that, when positioned in the header with the correct switches, will pick
up the first and last instances of a particular STYLE on each page. Problem is,
this shows the complete text. And Word doesn't provide any tools for working
with strings of text, so there's no simple way to tell Word to show only the
first letter.
It can be done using a set of complex IF fields. The following sample shows the
If fields for the letters A and T. You'd want 26 of them, one for each letter of
the alphabet.
{ If { Compare "{ styleref "myStyle" } " = "A*"} = 1 "A" "" }{ If { Compare "{
styleref "myStyle" } " = "T*"} = 1 "T" "" }
The Compare field is checking the content of the StyleRef field against "A*",
where the star means "any number of any characters". Essentially, it means if it
starts with A. If the Compare field returns true (1), then A is displayed,
otherwise nothing.
In order to create this you have to press Ctrl+F9 for each pair of { field
brackets } - you may NOT type them from the keyboard. Then type in the text to
complete each field.
Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org
This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail
