L
Larry
Hello all, I haven't posted here in quite a while.
The below macro copies the first hyperlink in the document. However, when
the hyperlink includes a nametag, the copy does not include the name tag.
For example, if the first hyperlink in the document is
http://www.mysite.com/xxxx.html#test
what the macro puts in the Clipboard is
http://www.mysite.com/xxxx.html
For whatever reason, the code
ActiveDocument.Hyperlinks(1).Address
does not include the nametag.
Is there any way I can get this macro to copy the nametag if there is one?
Thanks.
Here's the macro:
If ActiveDocument.Hyperlinks.Count = 0 Then
Exit Sub
End If
Dim MyData As DataObject
Dim strURL As String
strURL = ActiveDocument.Hyperlinks(1).Address
Set MyData = New DataObject
MyData.SetText strURL
MyData.PutInClipboard
The below macro copies the first hyperlink in the document. However, when
the hyperlink includes a nametag, the copy does not include the name tag.
For example, if the first hyperlink in the document is
http://www.mysite.com/xxxx.html#test
what the macro puts in the Clipboard is
http://www.mysite.com/xxxx.html
For whatever reason, the code
ActiveDocument.Hyperlinks(1).Address
does not include the nametag.
Is there any way I can get this macro to copy the nametag if there is one?
Thanks.
Here's the macro:
If ActiveDocument.Hyperlinks.Count = 0 Then
Exit Sub
End If
Dim MyData As DataObject
Dim strURL As String
strURL = ActiveDocument.Hyperlinks(1).Address
Set MyData = New DataObject
MyData.SetText strURL
MyData.PutInClipboard