View Single Post
  #8   Report Post  
Klaus Linke
 
Posts: n/a
Default

Hi Helen,

A trick I use is to apply a character style "Index" to all prospective =
index entries, and then use a macro to add XE fields for them when the =
document is done (see macro below).
You might still want to check each entry once (EditFind "^d XE" and =
have a quick look), and modify the text that shall appear in the index =
if needed (singular versus plural, capitalization, sub-entries, ...).

Greetings,
Klaus

Sub IndexForCharStyle()
Dim myCharStyle As String
Dim myEntry As String
Dim myField As Field

myCharStyle =3D "Index"
Selection.HomeKey (wdStory)
With Selection.Find
.ClearFormatting
.Style =3D myCharStyle
.Text =3D ""
.Forward =3D True
.Wrap =3D wdFindStop
.Format =3D True
End With
While Selection.Find.Execute
myEntry =3D Selection.Text
Selection.Collapse (wdCollapseEnd)
Selection.Fields.Add _
Range:=3DSelection.Range, _
Type:=3DwdFieldIndexEntry, _
Text:=3DChr(34) & Trim(myEntry) & Chr(34) ' & " \f ""m"""
Selection.Collapse (wdCollapseEnd)
Wend
Selection.EndKey Unit:=3DwdStory
Selection.TypeParagraph
' change the index field (language ...)
' below, or insert it by hand
Selection.Fields.Add _
Range:=3DSelection.Range, _
Type:=3DwdFieldIndex, _
Text:=3D"\c ""1"" \z ""1031"" \f ""m"""
Selection.WholeStory
Selection.Fields.Update
Selection.Collapse (wdCollapseEnd)
ActiveWindow.View.ShowFieldCodes =3D False
' If you want to immediately remove the index fields:
' For Each myField In ActiveDocument.Fields
' If myField.Type =3D wdFieldIndexEntry Then
' If InStr(myField.Code.Text, "\f ""m""") 0 Then
' myField.Delete
' End If
' End If
' Next myField
End Sub
=20



Helen wrote:
So - the answer is to go through the entire document sentence by =

sentence and=20
not each entry with an XE field? Any 'tricks' to speeding up that =

process?
=20
"Suzanne S. Barnhill" wrote:
=20
Singular vs. plural, I expect.
=20
--=20
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the =

newsgroup so
all may benefit.
=20
"Klaus Linke" wrote in message
...
No, they don't have XE fields because he was using a concordance,

=20
Missed the part about the "index table".
=20
and concordances take a notoriously literal view of indexing.

=20
Beyond the capitalization problem I mentioned?
=20
Regards,
Klaus
=20