[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 525
  • Last Modified:

Modify hyperlink in Outlook to new mapped drive?

Is there a software, macro, or process to change hyperlink locations from email source in Outlook 2003?
We have recently had some reorganization of mapped drives. Our legal department have emails with hyperlinks referencing the old map drive letter, and the hyperlinks in the email are aliased, so I can't use LBE Find and Replace to search for file:///F and change the F drive letter to P.
Thanks for any information you can provide.
  • 4
  • 3
1 Solution
David LeeCommented:
Hi, TechNovice-75.

I might be able to help, but I need to understand what you mean when you say, "the hyperlinks in the email are aliased".  
TechNovice-75Author Commented:
For example, in the email the hyperlink would display Plaintiff's Request for September dates, invisible to the reader of the location on the network where the file was located, unless they get the balloon when they hover over the link. That is what I meant by alias.
My first thought was, if there was a solution, it would be easy to change a hyperlink in the email if it was dispalyed as file:///F\[i]filename[/i]: or F:\filename, using a find and replace any instance of F: with P:
I right-clicked on the email to view source, but I'm not sure if this is the area to make the changes.
David LeeCommented:
Got it.  Then a simple search and replace ought to work.  Are all the messages in HTML format?
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

TechNovice-75Author Commented:
Yes, they are in HTML format.
David LeeCommented:
Ok.  Let's try this.  This code will replace all instances of "f:" with "p:" in all selected messages.  Follow these instructions to use this.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on Module1
4.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
5.  Edit the code as needed.  I included comments wherever something needs to or can change
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Make a copy of one of the messages you'd like to fix.
9.  Select the copy
10.  Run the macro
11.  Verify that the message was updated correctly

If this works the way you want it to, then I recommend making a backup copy of all the messages you want to process, then select and process the originals.  Keep in mind that this macro is going to repalce all instaces of f: without regard to where they occur in the message (i.e. not just in hyperlink URLs).
Sub FixHyperlinks()
    Dim olkMsg As Outlook.MailItem
    For Each olkMsg In Outlook.Application.ActiveExplorer.Selection()
        olkMsg.HTMLBody = Replace(LCase(olkMsg.HTMLBody), "f:", "p:")
    Set olkMsg = Nothing
End Sub

Open in new window

TechNovice-75Author Commented:
It works like a charm. Thank you for all your help.
David LeeCommented:
Thanks, and you 're welcome.  Glad I could help.

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now