Greg Maxey said:
Try:
Sub ScratchMacro()
Dim oFld As Field
For Each oFld In ActiveDocument.Fields
If oFld.Type = wdFieldHyperlink Then
oFld.Unlink
End If
Next
End Sub
Sorry Greg, but that only remove half the hyperlinks (try it!)
This will remove all of them
Sub ScratchMacro()
Dim iFld As Long
For iFld = ActiveDocument.Fields to 1 Step -1
If ActiveDocument.Fields(iFld).Type = wdFieldHyperlink Then
ActiveDocument.Fields(iFld).Unlink
End If
Next iFld
End Sub
Better still (i.e. quicker) is to avoid bothering with all the non-hyperlink
fields, like this
Sub ScratchMacro()
Dim iFld As Long
For iFld = ActiveDocument.Hyperlinks to 1 Step -1
ActiveDocument.Hyperlinks(1).Delete
Next iFld
End Sub
(Yes, it is repeatedly deleting the first hyperlink in the document. Think
about why that works <g>)
--
Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition
www.classicvb.org