Q
Quetzalcoatl
Hi,
Does anybody know why the h... the following macro is acting so strangely (Word
97/2000) ?
For Each LINK In ActiveDocument.Hyperlinks
LINK.Delete
Next
It should delete all hypertext links, but actually only delete 1 on 2, meaning
that you need to run it n+1 times for 2^n links.
If you replace "LINK.Delete" by "MsgBox LINK.Range", you can see *all* links
filing one by one.
Sure, the macro below works, but what a ploy !
StartAgain:
TMP = ActiveDocument.Hyperlinks.Count
If TMP = 0 Then Exit Sub
For I = 1 To TMP
On Error GoTo StartAgain
ActiveDocument.Hyperlinks(I).Range.Select
Selection.Delete
Next
This one below works too, but it's a bit drastic and you can't do any test on
the link before deletion (for a selective deletion).
Selection.WholeStory
Selection.Fields.Unlink
Any good idea ?
Thanks.
Does anybody know why the h... the following macro is acting so strangely (Word
97/2000) ?
For Each LINK In ActiveDocument.Hyperlinks
LINK.Delete
Next
It should delete all hypertext links, but actually only delete 1 on 2, meaning
that you need to run it n+1 times for 2^n links.
If you replace "LINK.Delete" by "MsgBox LINK.Range", you can see *all* links
filing one by one.
Sure, the macro below works, but what a ploy !
StartAgain:
TMP = ActiveDocument.Hyperlinks.Count
If TMP = 0 Then Exit Sub
For I = 1 To TMP
On Error GoTo StartAgain
ActiveDocument.Hyperlinks(I).Range.Select
Selection.Delete
Next
This one below works too, but it's a bit drastic and you can't do any test on
the link before deletion (for a selective deletion).
Selection.WholeStory
Selection.Fields.Unlink
Any good idea ?
Thanks.