GlennMc was telling us:
GlennMc nous racontait que :
Selection.HomeKey Unit:=wdStory
' Find and delete duplicate index fields
For X = 1 To 2500
Why this arbitrary statement? Why 2500?
Selection.Find.ClearFormatting
With Selection.Find
.Text = " XE "
I guess there is some missing code otherwise, as is, XE may not be found if
hidden text is not shown.
.Forward = True
.Wrap = wdFindAsk
'.Format = True
'.MatchCase = False
'.MatchWholeWord = False
'.MatchWildcards = False
'.MatchSoundsLike = False
'.MatchAllWordForms = False
End With
Selection.Find.Execute
I do not understand the purpose of these two lines of code:
Selection.Extend Character:=""""
Selection.Extend Character:=""""
With Selection
Word1 = Selection
If Word1 = Word3 Then
Selection.Delete
Selection.EndKey Unit:=wdLine
Else
Selection.EndKey Unit:=wdLine
End If
End With
Selection.Find.Execute
Selection.Extend Character:=""""
Selection.Extend Character:=""""
With Selection
Word2 = Selection
End With
If Word1 = Word2 Then
Selection.Delete
Word3 = Word2
Else
Word3 = Word2
Selection.EndKey Unit:=wdLine
End If
Next
I think you forgot to show us all the relevant code, or, if not, this code
as is, may not work all the time.
Also, you never explained what you expected from
.Wrap = wdFindAsk
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org