separate the hyperlink from text in a mail in a mail in outlook

oakse

Recruit
hello,

I always need to get the hyperlink in the email. But I need to put the cursor over the text which have been inserted the hyperlink to see the real hyperlink.

Can just separate the hyperlink from displaying text in a mail, so that I can get the hyperlink addresses straightly?
 
You can write VBA code to do that . I search it on google and find a code as below:

Code:
Sub ShowAllHyperlinkAddresses()
    Dim objMail As Outlook.MailItem
    Dim objWordDocument As Word.Document
    Dim objWordApp As Word.Application
    Dim objWordSelection As Word.Selection
    Dim objHyperlinks As Word.Hyperlinks
    Dim objHyperlink As Word.Hyperlink
    Dim strLink As String
    Set objMail = Outlook.Application.ActiveInspector.CurrentItem
    Set objWordDocument = objMail.GetInspector.WordEditor
    Set objWordApp = objWordDocument.Application
    Set objHyperlinks = objWordDocument.Hyperlinks
    If objHyperlinks.Count > 0 Then
       For Each objHyperlink In objHyperlinks
           strLink = objHyperlink.Address
           strLink = vbTab & "<" & strLink & ">"
           objHyperlink.Range.InsertAfter strLink
           objHyperlink.Delete
           With objWordApp.Options
                .AutoFormatReplaceHyperlinks = True
                .AutoFormatApplyOtherParas = False
                .AutoFormatApplyHeadings = False
                .AutoFormatApplyBulletedLists = False
                .AutoFormatApplyLists = False
                .AutoFormatApplyFirstIndents = False
          End With
          Set objWordSelection = objWordApp.Selection
          objWordSelection.Range.AutoFormat
       Next
    End If
End Sub

Hope it helps.
 
Last edited by a moderator:
Back
Top