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, or forward it internally, identifying information remains in place in a "Safe Link" from Microsoft. This adds extra difficulty in the fact that sometimes, the links simply do not work after conversion.
Not a huge deal, but it bugs me since links I forward now have my email address attached.
So I found the following code that successfully replaces the Address property of hyperlinks. I'm calling it from another macro that runs before I send an email and checs to see if there are any "safe" links:
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
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 to the VBAExpress forums since they have an Outlook specific forum.
http://www.vbaexpress.com/forum/showthread.php?65114-Convert-Hyperlink-Address-Property-to-Text
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, or forward it internally, identifying information remains in place in a "Safe Link" from Microsoft. This adds extra difficulty in the fact that sometimes, the links simply do not work after conversion.
Not a huge deal, but it bugs me since links I forward now have my email address attached.
So I found the following code that successfully replaces the Address property of hyperlinks. I'm calling it from another macro that runs before I send an email and checs to see if there are any "safe" links:
Code:
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
Code:
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 to the VBAExpress forums since they have an Outlook specific forum.
http://www.vbaexpress.com/forum/showthread.php?65114-Convert-Hyperlink-Address-Property-to-Text
Last edited: