ASKER
Sub Macro1()
Dim oFld As Field
Dim oCount As Integer
Dim oRange As Word.Range
Open "c:\tmp\hyperlinks.txt" For Output As #1
oCount = 0
With ActiveDocument
.Range.AutoFormat
For Each oRange In .StoryRanges
Do
For Each oFld In oRange.Fields
If oFld.Type = wdFieldHyperlink Then
'MsgBox ActiveDocument.Hyperlinks.Item(oFld.Index).TextToDisplay, vbOKOnly, oCount = oCount + 1
Write #1, ActiveDocument.Hyperlinks.Item(oFld.Index).TextToDisplay
oCount = oCount + 1
End If
Next oFld
Set oRange = oRange.NextStoryRange
Loop Until oRange Is Nothing
Next oRange
Close #1
MsgBox "Total Detected HyperLinks=" & oCount
End With
End Sub
ASKER
ASKER
VBScript (Visual Basic Scripting Edition) is an interpreted scripting language developed by Microsoft that is modeled on Visual Basic, but with some important differences. VBScript is commonly used for automating administrative and other tasks in Windows operating systems (by means of the Windows Script Host) and for server-side scripting in ASP web applications. It is also used for client-side scripting in Internet Explorer, specifically in intranet web applications.
TRUSTED BY
Example with function is included