Results 1 to 2 of 2

Thread: How to manipulate index entries ({xe})

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Apr 2005

    How to manipulate index entries ({xe})

    I have a Word document with a load of tags in the form {xe "index entry 1"}{xe "index entry 2"}. They correspond to entries in the index.

    However, these tags are badly formatted, and I need to change the font name and size of each tag (I know they don't print out or show up with hidden text switched off, but I use them for an intermediate purpose).
    I'm trying to find a way to select each tag in turn and change its formatting, but no combination of search terms and regexps succesfully finds them.
    I don't know if Word considers these as objects, as I can't find a member class called IndexEntry or CrossReference or anything similar. I tried with Bookmarks, but those are not the same thing.

    Has anyone any tips?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Apr 2005

    Re: How to manipulate index entries ({xe})

    Got a tip from a colleague - I needed to search for Fields of type wdFieldIndexEntry.
    VB Code:
    1. Sub FixIndexEntries()
    2.     Dim fField As field
    4.     For Each fField In ActiveDocument.Fields
    5.         If fField.Type = wdFieldIndexEntry Then
    6.             fField.Select
    7.             Selection.Font.Name = "Times New Roman"
    8.             Selection.Font.Size = 11
    9.             Selection.Font.Color = wdColorAutomatic
    10.         End If
    11.     Next fField
    13. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Click Here to Expand Forum to Full Width