ievakr
03-16-2022, 08:39 AM
Hello,
What I want to do, is for macro to find all hyperlinks with word "servlet" in the address and delete the hyperlink:
Sub Link()
Dim H As Hyperlink
For Each H In ActiveDocument.Hyperlinks
If InStr(H.Address, "servlet") <> 0 Then
H.Delete
End If
Next H
End Sub
But H.Delete breaks the Next H function and in result only every second hyperlink is deleted and I have to run the macro again. Meanwhile H.Follow works like a charm in this code.
What can it be?
What I want to do, is for macro to find all hyperlinks with word "servlet" in the address and delete the hyperlink:
Sub Link()
Dim H As Hyperlink
For Each H In ActiveDocument.Hyperlinks
If InStr(H.Address, "servlet") <> 0 Then
H.Delete
End If
Next H
End Sub
But H.Delete breaks the Next H function and in result only every second hyperlink is deleted and I have to run the macro again. Meanwhile H.Follow works like a charm in this code.
What can it be?