Forum Discussion
Mehmetbukum
Sep 29, 2022Copper Contributor
Edit index entries
i have got thousands index entries. can i edit { XE "joe" } as { XE "joe" \f "a"} by a macro
You can use a macro to loop through the fields, let the macro check if the field type is XE and then take the required action.
Should the \f "a" switch be added to all of your XE fields? Or is there some other pattern that can be specified?
- MehmetbukumCopper Contributor
yes, all XE fields must switch with \f "a" Stefan_Blom
OK, since you want to modify all the XE fields, try the following:
Sub ModifyAllXEFields() 'Stefan Blom, MVP, September 2022 Dim f As Field For Each f In ActiveDocument.Fields If f.Type = wdFieldIndexEntry Then f.Code.Text = f.Code.Text & " \f ""a""" End If Next f End Sub
For installation instructions, see http://www.gmayor.com/installing_macro.htm.