Dictionary Type Headings

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?

Thanks!
 
Hi TJAC:

Look at the on-line help in MS Word and search for "Create a
dictionary-style page header" which will search on the page for the style of
your choice (s.a. "heading 1", "header", etc) and base the word(s) selection
using StyleRef keyword.

In short, you end up placing 2 fields- the first one which chooses where to
look for the font style, s.a. "Insert Position of Paragraph" (which is what
you want, BTW!); the second field you select "Search from bottom of the page
to top".

It works very well...

Cheers,
Al
 
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 :-)
 
Hi Cindy, TJAC
{ If { Compare "{ styleref "myStyle" } " = "A*"} = 1 "A" "" }{ If { Compare "{
styleref "myStyle" } " = "T*"} = 1 "T" "" }

interesting idea, didn't know you could compare with wilds like this.

TJ, just in case you're really planning to create the 26 fields: what
works here, too, is:

{ If "{ styleref "myStyle" }" = "A*" "A" "" }

Hopefully, all your relevant entries start with capital letters
(otherwise you need 26 more entries with lower letters, or even more if
you are faced with any umlauts, or more complex characters ...

HTH
Robert
 
Robert said:
{ If "{ styleref "myStyle" }" = "A*" "A" "" }

always good reading one's own posts, then the real thinking starts: the
following works, too, "of course:"

{ If "{ styleref "myStyle" }" = "A*" "A" }

HTH
Robert
 
If there are upper and lower cases involved you could add another switch,
and the second pair of quotes is superfluous when empty.

{ If "{ styleref "Heading 1" \*Upper }" = "A*" "A" }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
Wouldn't it be simpler to apply a character style to the first letter of
each entry and use the StyleRef field to pick that up?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 

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

Back
Top