Thanks for your answer.
Here is an example, with in total three index entries (two with only main
entry, the third with additional subentry):
The currently relevant results <$Iresults;relevant> from this development
<$Idevelopment> are the following approvals <$Iapprovals>.
The following code should convert entries such as that to XE field codes:
Dim myrange As Range, Code As String
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(Findtext:="\<$I*\>", Forward:=True, _
MatchWildcards:=True, Wrap:=wdFindStop) = True
Set myrange = Selection.Range
myrange.Text = Replace(myrange.Text, ";", ":")
Code = Mid(myrange, 4, Len(myrange) - 4)
myrange.Text = ""
ActiveDocument.Fields.Add myrange, wdFieldEmpty, "XE " &
Code
Loop
End With

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Thanks for your answer.
> Here is an example, with in total three index entries (two with only main
[quoted text clipped - 36 lines]
>> >
>> > Matthias
Matthias - 13 May 2008 08:53 GMT
Dear Doug,
thank you so much for your help, it works! I´ve got only one problem, all
replaced index entries look like following:
{ XE approvals \* MERGEFORMAT }
Can you give me a tip how the string \* MERGEFORMAT can be avoided?
Thanks in advance for your fantastic work!
> The following code should convert entries such as that to XE field codes:
>
[quoted text clipped - 61 lines]
> >> >
> >> > Matthias
Klaus Linke - 13 May 2008 12:20 GMT
Hi Matthias,
Replace the line starting with ActiveDocument.Fields.Add:
ActiveDocument.Fields.Add _
Range:=myrange, _
Type:=wdFieldEmpty, _
Text:="XE " & Chr(34) & Code & Chr(34), _
PreserveFormatting:=False
' The last line gets rid of \* MERGEFORMAT
Regards,
Klaus
Matthias - 13 May 2008 14:02 GMT
Klaus,
thank you thousand times, wonderful, it works perfectly!
Matthias
> Hi Matthias,
>
[quoted text clipped - 9 lines]
> Regards,
> Klaus