September 17, 2001 10:17 PM

Making Contact

Rating: (0)
Windows IT Pro
InstantDoc ID #22254
Reestablish links to Outlook contacts after exporting a mailbox
Sooner or later, every administrator of a Microsoft Exchange Server 5.5 (or earlier) system needs to move a mailbox from one site or container to another. A classic solution is to export the entire mailbox to a personal store (.pst) file, add the new mailbox, then import the .pst data into the new mailbox. Alternatively, you can use the Microsoft BackOffice Resource Kit's Exmerge utility to help automate that process.

Many a...

ARTICLE TOOLS

You must be a paid Professional Member to access this entire article.

Already a Professional Member? Please log in now:

NOT A PROFESSIONAL MEMBER? YOU CHOOSE:

Monthly or Annual

Professional Membership

VIP Membership

Compare Member Benefits

Add a Comment

Check out this great tutorial on using Microsoft Outlook for managing your ebay & amazon sales, or use it as an Outlook programming quickstart:

http://www.321books.co.uk/ebooks/outlook-vba-tutorial.htm



mal4mac9/17/2004 3:49:01 AM


I found another fix that worked perfectly:
http://support.microsoft.com/?kbid=242074
This is a utility to clear OL's nickname cache.

ROBERT7/7/2004 11:47:13 AM


I ran the script, but nothing seems to happen. The script says it's running and finishes in less than 30 seconds. I have thousands of contacts so I expected it to run for a while. The error is not fixed after running the script.

I'm running OL 2000 SP-3 under Win2K. I ran the script by importing it into OL's VB engine, using Run Macro, and clicking my Contacts folder. Do I need to do anything else?

ROBERT7/7/2004 10:39:42 AM


Hi Sue Mosher,
I see that Object Link name doesn't contain the Preffix Name, In this case the script doesn't work because objLink.Name <> FullName. So one suggestion is to parse ObjLink.name into FirstName, MiddleName, LastName and use them as criteria for search. I hope this is not just an error in My outlook contacts. Thanks for your Article.

Alami 4/7/2004 11:26:43 AM


Don, copy and paste the code from the .txt file into an Outlook VBA module. If you need really, really basic info, see http://www.win2000mag.com/Articles/Index.cfm?ArticleID=21522

Sue Mosher 1/28/2004 5:00:32 AM


Goran, take a look at the Namespace.PickFolder method, which returns a MAPIFolder that the user selects.

Sue Mosher 1/28/2004 5:00:32 AM


Hello! I was very pleased to find this article, since the hundreds of links in my OL2002 .pst file were lost when I was required to export/import everything to fix another problem. However, not being a Visual Basic expert, I can't figure out how to actually run the code you provide with this article. I tried renaming the .txt file to .vbs and that didn't work. Can you tell me how to run the code? Thank you!

Don Ferguson 11/28/2003 11:15:26 PM


Running XP Home Edition with XP Office Pro:
Gave very erratic results -- some worked, others didn't. Blanked out names, etc. Changed the REGISTRY as suggested, but there was no difference. Standard form replaced custom form here and there, etc.

norm hadley 6/29/2003 3:54:56 PM


Change the vb code to allow for a manual pick of contacts folder, ie not hardcoded. If you have contacts stored in another folder, this is very appriciated.



Sub ReconnectLinks()

  Dim objApp As Application

  Dim objNS As NameSpace

  Dim objFolder As MAPIFolder

  Dim colItems As Items

  Dim objItem As Object

  Dim colLinks As Links

  Dim objLink As Link

  Dim colContacts As Items

  Dim objContact As ContactItem

  Dim strFind As String

  Dim intCount As Integer

  Dim myFolder1 As MAPIFolder





  Set objApp = CreateObject("Outlook.Application")

  Set objNS = objApp.GetNamespace("MAPI")

  'set contacts folder

  Set myFolder1 = objNS.PickFolder

  'set tasks folder

  Set objFolder = objNS.PickFolder

  If TypeName(objFolder) <> "Nothing" Then

    'Set colContacts = objNS.GetDefaultFolder(olFolderContacts).Items
    Set colContacts = myFolder1.Items

    Set colItems = objFolder.Items

    For Each objItem In colItems



      Set colLinks = objItem.Links

      intCount = colLinks.Count

      If intCount > 0 Then

        For i = intCount To 1 Step -1

          Set objLink = colLinks.Item(i)

          On Error Resume Next



          If objLink.Item Is Nothing Then



            strFind = "[FullName] = " & AddQuotes(objLink.Name)

            Set objContact = colContacts.Find(strFind)



            If Not objContact Is Nothing Then

            ' remove the old link

            colLinks.Remove i

            ' add the replacement link

            colLinks.Add objContact

            End If

          End If

        Next

        If Not objItem.Saved Then

          objItem.Save

        End If

      End If

    Next

  End If



  Set objLink = Nothing

  Set colLinks = Nothing

  Set objItem = Nothing

  Set objItems = Nothing

  Set objFolder = Nothing

  Set objNS = Nothing

    Set objApp = Nothing

End Sub



Private Function AddQuotes(MyText) As String

    AddQuotes = Chr(34) & MyText & Chr(34)

End Function



Göran Eriksson 10/10/2002 6:22:36 AM


You must log on before posting a comment.

Are you a new visitor? Register Here
Free Power Tools Brochure
Get Mark Minasi's 17-page guide today!



      

advertisement

GOOGLE LINKS
SPONSORED LINKS
FEATURED LINKS

White Papers

Your remote offices contain valuable electronic data – are they adequately protected? Learn how proven technologies can reliably and cost-effectively back up a branch office from a central location, in real time, to disk or tape, and even utilize existing backup solutions.

Downloads

PacketTrap IT is a comprehensive and affordable network management and application monitoring solution that solves problems associated with bandwidth, network and application performance, and connectivity. Gain insight into your network - try PacketTrapIT free for 21 days!

Web Seminars

IT administrators have to solve a myriad of problems. This web seminar outlines the ten most common systems management pains - including managing highly distributed systems and dealing with data theft/loss – and the best practices to address each.

eLearning Series

We bring the experts direct to you to share their real-world perspective and expertise. During each event, three sessions stream in real time, so you can learn, ask questions, and get solutions.
Upcoming event: Getting the Most with Exchange 2010 with Paul Robichaux

Subscribe to Windows IT Pro!

Windows is a trademark of the Microsoft group of companies. Windows IT Pro is used by Penton Media Inc. under license from owner.