How do I run this existing VBA procedure to re-link Journal Items to Contacts?

Posted on 2009-12-22
Last Modified: 2013-11-25
I have several thousand journal items that have been manually linked to contacts in a folder. I  imported those journal items into another folder (which contains identical contacts) and need to relink them.

There is existing VBA code  by Sue Mosher at which says:
 "Run this VBA procedure to replace a non-functioning link in the Links collection with a new link to the contact with the same name in the Contacts folder."

I believe this code may do the job (based on comments to the post) but, although very computer literate, I am NOT a programmer and do not know how to implement this VBA procedure.  Would like someone to explain how to do this.

Question by:japple1
    LVL 84
    You'd need to open the VBA Editor in Outlook (Tools - Macros - Visual Basic Editor), then add a Module (Insert - Module). Copy/paste the code at the link provided (note there is a fix in the comment section below the code), then Save the file (make sure to name your module something like "basRoutines"). Now, click View - Immediate, and type this in the Immediate window:

    Call FixContactLinks

    and press the Enter key. The code should run, or you may get an error message if something is amiss. If the code seems to run, and you don't get any error messages, then check your journal items to see if they're linked.

    Note also that performing tasks like this is non-reversible. I would strongly encourage you to make a full Outlook backup before proceeding.

    Author Comment

    LSMConsulting - Thanks for your quick reply. I followed your instructions and the links do not get changed. Per the comments, I added a breakpoint at the "For Each" statement, then pressed F8 to step thru the code and see the following happen:

    When I run this against the Journal Folder, excecution jumps from the "If objItem.Class = olContact Then" the execution jumps to an End statement, presumably because the object is not a Contact. When I run it against the Contacts folder, at the "IF intCount > 0", execution jumps to the EndIf, so none of the linking code is executing, but I'm not sure what that is telling me. [like I said, I'm not a programmer]  I don't get any error messages, it just iterates and then finishes. Which folder should this be running against to establish the links between the contact and journal item?

    Also, I pasted the "Debug.Print objItem.Subject, objItem.Links.Count" above the ForEach but nothing is appearinging in the Immediate Window as the comments would suggest.

    Any ideas?
    LVL 84

    Accepted Solution

    So the code is running, but it's just not working. I'm not fluent enough with Outlook to be able to rework it for you reliably, so I'd suggest you use the Request Attention link (near your original question text) to ask the Moderators to send out a Call for Experts.

    Author Closing Comment

    I'll accept your solution since you guided me through the process of at least trying to run it. It isn't your fault the code didn't work. I believe I have found a commercial program that will resolve the issue. It's expensive but it does many other cool things with Outlook data so I should get a lot of utility out of it. Thanks!

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Find out how to use dynamic social media in email signatures with this top 10 DOs & DON’Ts.
    Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
    Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
    Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

    746 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

    18 Experts available now in Live!

    Get 1:1 Help Now