Modify hyperlink in Outlook to new mapped drive?

Posted on 2009-02-11
Last Modified: 2012-05-06
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.
Question by:TechNovice-75
    LVL 76

    Expert Comment

    by:David Lee
    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".  

    Author Comment

    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.
    LVL 76

    Expert Comment

    by:David Lee
    Got it.  Then a simple search and replace ought to work.  Are all the messages in HTML format?

    Author Comment

    Yes, they are in HTML format.
    LVL 76

    Accepted Solution

    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


    Author Closing Comment

    It works like a charm. Thank you for all your help.
    LVL 76

    Expert Comment

    by:David Lee
    Thanks, and you 're welcome.  Glad I could help.

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Use email signature images to promote corporate certifications and industry awards.
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
    This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now