|
-
Aug 29th, 2005, 06:15 AM
#1
Thread Starter
Lively Member
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?
-
Aug 29th, 2005, 06:25 AM
#2
Thread Starter
Lively Member
Re: How to manipulate index entries ({xe})
Got a tip from a colleague - I needed to search for Fields of type wdFieldIndexEntry.
VB Code:
Sub FixIndexEntries()
Dim fField As field
For Each fField In ActiveDocument.Fields
If fField.Type = wdFieldIndexEntry Then
fField.Select
Selection.Font.Name = "Times New Roman"
Selection.Font.Size = 11
Selection.Font.Color = wdColorAutomatic
End If
Next fField
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|