S
Sasa
I am trying to make Find cycle that is searching for
special format. Everything works fine but there are places
in document which doesnt contain any text but got this
format. I have wrote condition which have to skip those
places, but unforunately code is not working. Seems to be
because my condition. I think its not correctly defined.
Can anyone help?
Here is the code:
Dim Nrml As Style
Set Nrml = ActiveDocument.Styles("Normal")
Dim i As Integer
For i = 1 To iCcount
Selection.Find.ClearFormatting
Selection.Find.Font.Color = RGB(0, 0, 51)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
End With
Selection.Find.Execute
If Selection.Characters.Count < 2 Then
Next
Else
Selection.Font.Italic = False
Selection.Style = Nrml
If i = iCount Then
Exit For
End If
End If
Next
Sasa
special format. Everything works fine but there are places
in document which doesnt contain any text but got this
format. I have wrote condition which have to skip those
places, but unforunately code is not working. Seems to be
because my condition. I think its not correctly defined.
Can anyone help?
Here is the code:
Dim Nrml As Style
Set Nrml = ActiveDocument.Styles("Normal")
Dim i As Integer
For i = 1 To iCcount
Selection.Find.ClearFormatting
Selection.Find.Font.Color = RGB(0, 0, 51)
With Selection.Find
.Text = ""
.Replacement.Text = ""
.Forward = True
.Wrap = wdFindContinue
.Format = True
End With
Selection.Find.Execute
If Selection.Characters.Count < 2 Then
Next
Else
Selection.Font.Italic = False
Selection.Style = Nrml
If i = iCount Then
Exit For
End If
End If
Next
Sasa