HOW TO REBUILD THE NICKNAME CACHE

 

The nickname cache maintains a list of addresses that you have previously used in Outlook. Unfortunately it can be lost or become corrupt if Outlook is not shutdown properly. The following instructions show you how to run a macro that will create an email with all the addresses in you Sent Items, which effectively rebuilds the nickname cache.

Open Outlook 2003. Press Alt-F11 to bring up the Visual Basic Editor. Expand Project1->Microsoft Office Outlook Objects and then double click on ThisOutlookSession.

 

Copy and paste the following code into the top right hand window.

Public Sub GetSentItemsAddresses()
    Dim olApp As New Outlook.Application
    Dim myNamespace As NameSpace
    Dim oSentItems As Outlook.MAPIFolder
    Dim oEmail As Outlook.MailItem
    Dim oNewEmail As Outlook.MailItem
    Dim oToString As String
    Dim oRecipientName As Outlook.Recipient
    Dim oEmailSubject As String
 
    oEmailSubject = "Build Nickname Emails"
 
    If MsgBox("Cancel now if you are not working offline (otherwise you will send a blank email to everyone you have ever sent en email to).", vbOKCancel, "Confirm you are Offline") = vbCancel Then Exit Sub
 
    Set myNamespace = olApp.GetNamespace("MAPI")
    Set oSentItems = myNamespace.GetDefaultFolder(olFolderSentMail)
 
    For Each oEmail In oSentItems.Items
        For Each oRecipientName In oEmail.Recipients
            If InStr(1, oRecipientName.Address, "@") <> 0 And InStr(1, oToString, oRecipientName.Address) = 0 Then
                oToString = oToString + oRecipientName.Address + ";"
            End If
        Next
    Next
 
    ' send a new email (which will save the addresses in the nickname file)
    Set oNewEmail = olApp.CreateItem(olMailItem)
    oNewEmail.To = oToString
    oNewEmail.Subject = oEmailSubject
    oNewEmail.Send
 
    MsgBox "Please delete the email named " + oEmailSubject + " from the Outbox"
End Sub

Your window should look like this.

Close the Microsoft Visual Basic window. Disconnect from the internet either by disabling you network card or setting Outlook into offline mode. Then press Alt-F8 to bring up the Macro window. Select the GetSentItemsAddresses macro and click Run.

Make sure you are not connected to the internet or that Outlook is in Offline mode (this is very important because otherwise you will send a blank email to everyone you have ever sent an email to). Then click OK.

Tick Allow access for and click Yes.

Click Yes.

Click OK.

Delete the email with the subject Rebuild Nickname Emails in the Outbox. You can then go back online.



We are committed to continuously improving user satisfaction, Computer Doctor welcomes your product concepts, feature requests or comments.
Please phone Tech Support on 0755924733 for additional support.

   

Yes

4

3

2

No

 

Why did you rate this information this way?

 

Is this information Useful?

Is this information accurate?

Your email address (optional)