The below vba code for MS Word (described here: text works very well for converting urls added to XE codes in Word to hyperlinks. However it does not work in footnotes. Does anyone know how to edit the visual basic code so it will do this?
Thanks
Sub MakeConcordance() '
Const hBase As String = "../Text/"
Const htm As String = ".htm"
Dim aCell As Cell
Dim aString As String
For Each aCell In ActiveDocument.Tables(1).Columns(2).Cells
aString = hBase & Trim(Left$(aCell.Range.Text, (Len(aCell.Range.Text) - 2))) & htm
aCell.Range.Text = aString
Next aCell
End Sub
Sub MakeHyperlinks()
Dim afield As Field
Dim url As String
Dim isHyper As Integer
For Each afield In ActiveDocument.Fields
If afield.Type = wdFieldIndexEntry Then
isHyper = 0
afield.Select
Selection.Collapse
url = Right$(afield.Code, Len(afield.Code) - 5)
url = Left$(url, Len(url) - 2)
If Left$(url, 4) = "../F" Then
isHyper = 1
End If
If Left$(url, 4) = "../T" Then
isHyper = 2
End If
If isHyper <> 0 Then
Selection.MoveStart unit:=wdCharacter, Count:=-3
Selection.MoveStart unit:=wdWord, Count:=-isHyper
afield.Delete
ActiveDocument.Hyperlinks.Add Anchor:=Selection.Range, _
Address:=url
End If
End If
Next afield
End Sub
XE codes can be added in MS Word with the AutoMark tool under References . . . Insert Index, but I don’t see how to convert those codes to hyperlinks unless I strip out the footnotes to end notes – but then it’s too difficult to convert the end notes back to footnotes.