S
sprungli
Is it possible to insert a hyperlink object instead of a text in a Word
Find-Replace? I found the code below in the VBA help. My goal is to have a
hyperlink which TextToDisplay property (let say http://localhost/MyApp or
C:\Temp\MyApp.exe) will appear in place of the myRange.Find.Replacement.Text
value.
Sub m1()
Set myRange = ActiveDocument.Range(Start:=0, End:=0)
With myRange.Find
.ClearFormatting
.Text = "Some text to find"
With .Replacement
.ClearFormatting
.Text = "Some replacement text"
' ? add Hyperlink instead of text
.Font.Bold = True
End With
.Execute Replace:=wdReplaceAll, _
Format:=True, MatchCase:=True, _
MatchWholeWord:=True
End With
End Sub
Thanks in advance for any suggestions.
Find-Replace? I found the code below in the VBA help. My goal is to have a
hyperlink which TextToDisplay property (let say http://localhost/MyApp or
C:\Temp\MyApp.exe) will appear in place of the myRange.Find.Replacement.Text
value.
Sub m1()
Set myRange = ActiveDocument.Range(Start:=0, End:=0)
With myRange.Find
.ClearFormatting
.Text = "Some text to find"
With .Replacement
.ClearFormatting
.Text = "Some replacement text"
' ? add Hyperlink instead of text
.Font.Bold = True
End With
.Execute Replace:=wdReplaceAll, _
Format:=True, MatchCase:=True, _
MatchWholeWord:=True
End With
End Sub
Thanks in advance for any suggestions.