Consulting

Results 1 to 1 of 1

Thread: Convert Hyperlink Address Property to Text

  1. #1

    Convert Hyperlink Address Property to Text

    Hello,

    I don't normally venture in to Outlook programming, but I have a problem I'm trying to solve. My organization recently enabled ATP for incoming outlook email links from external sources. So now, when I reply to an email, identifying information remains in place in a "Safe Link" from Microsoft.

    Not a huge deal, but it bugs me.

    So I found the following code that successfully replaces the Address property of hyperlinks:

    Sub HyperLinkChange()Dim objDoc As Object
    Dim tmpLink As Object
        On Error Resume Next
        If ActiveInspector.EditorType = olEditorWord Then
            ' use WordEditor Inspector
            Set objDoc = ActiveInspector.WordEditor
            For Each tmpLink In objDoc.Hyperlinks
                tmpLink.Address = "Hyper Link Removed. Please copy and paste into your browser to view"
            Next tmpLink
        End If
    End Sub
    I wanted to expand on this, and only run the code to replace if it's actually an ATP Safe Link.

    I found that if I use something like

    response = msgbox(tmpLink.Address)
    a dialog box is presented with the link. But if I try to evaluate tmpLink.Address as a string, it's just blank.

    Is there a way to convert tmpLink.Address in this situation to a string that can be evaluated?

    ETA:

    I cross-posted this over to the MrExcel forums since that's normally where I've been active. If that's against any rules, please feel free to delete.

    https://www.mrexcel.com/forum/genera...e-sending.html
    Last edited by BAlGaInTl; 05-08-2019 at 08:20 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •