Re: Index by Matthias
Matthias
Tue May 13 00:53:29 PDT 2008
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!
"Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im Newsbeitrag
news:Oh5pJFMtIHA.1872@TK2MSFTNGP04.phx.gbl...
> 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
>
>
> --
> 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
>
> "Matthias" <matthiashb@hotmail.com> wrote in message
> news:g09mgl$lli$00$1@news.t-online.com...
> > 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>.
> >
> >
> >
> >
> > "Doug Robbins - Word MVP" <dkr@REMOVECAPSmvps.org> schrieb im
Newsbeitrag
> > news:uFI$cB7sIHA.4912@TK2MSFTNGP03.phx.gbl...
> >> I am not really clear about what is actually in the document -
> >>
> >> There are two forms (both nomal text in the file):
> >> - <$Imainentry>
> >> - <$mainetry;subentry>.
> >>
> >> Can you paste a chunk of the text that contains such items into a
message
> > so
> >> that I, at least, can be sure what you have to start with.
> >>
> >> --
> >> 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
> >>
> >> "Matthias" <matthiashb@hotmail.com> wrote in message
> >> news:g06v1p$ns5$02$1@news.t-online.com...
> >> >I want to index a book in word - and there are already hundreds of
> >> >exisiting
> >> > index entries in the text, produced an older programm.
> >> >
> >> > There are two forms (both nomal text in the file):
> >> > - <$Imainentry>
> >> > - <$mainetry;subentry>.
> >> >
> >> > Can this be achieved in VBA? Replace these existing text fields with
> > word
> >> > index fields {XE }?
> >> >
> >> > Thanks for every answer/help!
> >> >
> >> > Matthias
> >> >
> >> >
> >>
> >>
> >
> >
>
>