Outlook 2007 - Master category list missing

mmmfg
mmmfg used Ask the Experts™
on
I recently moved a user from pop3 to an exchange account in Outlook 2007. Everything worked well until he realized his many custom categories were missing. When you open a contact and look at the category, it is white and says the master category list is missing.

I did some research and ran "Upgrade to color categories." It gives me a prompt saying it will take a while, I click through, nothing happens, and his categories still do not appear. This appears to be the case for many people in online forums, but no one has a solution.

I also created another profile and imported his PST backup into this account. Still no master categories.

Any ideas? Thanks!
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2010
Commented:
Hi, mmmfg.

The "Upgrade to color categories" is for use when upgrading from Outlook 2003 and earlier to Outlook 2007.  Outlook 2003 and earlier stores categories in the registry.  Outlook 2007 stores them in a hidden folder in the default mailbox.  Outlook does not have a built-in means of importing categories to another mailbox.  If you want to create a new profile, configure it use POP3, and set the existing PST file as the default, then I can provide a script that will export the categories to a text file, and another that will import them into the Exchange mailbox profile.

Author

Commented:
I won't have a chance to work on the computer until tomorrow, but that sounds like a great idea! If you can provide me with the scripts, I will test them then and let you know how it turns out.

Thanks!
Top Expert 2010

Commented:
The code comes in two parts.  This is part 1.  Follow these instructions to use it.

a.  From the menu click Tools > Macro > Visual Basic Editor or press ALT+F11 to open Outlook's VB Editor window.
b.  From the menu click Insert > Class Module.
c.  In the Properties pane (lower left-hand corner) click in the Name field and enter CategoryProcessor.
d.  Copy the code in the snippet below and paste it into the right-hand pane of the VB editor.
e.  Click the diskette icon on the toolbar to save your changes.

Option Explicit
 
'*** Constants'
Const CB_APPNAME = "CategoryProcessor"
Const CB_VERSION = "1.0"
Const ForReading = 1
 
'*** Class Variables'
Private bolInitialized As Boolean
Private intCount As Integer
Private objFSO As Object
Private objFile As Object
Private olkCategory As Object
Private strDefaultFilename As String
    
Private Sub Class_Initialize()
    Dim arrVersion As Variant
    arrVersion = Split(Outlook.Application.VERSION, ".")
    If arrVersion(0) < 12 Then
        MsgBox "This object only works with Outlook 2007 and higher.", vbCritical + vbOKOnly, CB_APPNAME
    Else
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        strDefaultFilename = Environ("USERPROFILE") & "\My Documents\Outlook Categories.txt"
        bolInitialized = True
    End If
End Sub
 
Private Sub Class_Terminate()
    Set objFSO = Nothing
End Sub
 
Public Sub Export(Optional strFilename As String)
    Dim strFileUsed As String
    If bolInitialized Then
        intCount = 0
        strFileUsed = IIf(strFilename = "", strDefaultFilename, strFilename)
        Set objFile = objFSO.CreateTextFile(strFileUsed, True)
        For Each olkCategory In Outlook.Session.Categories
            objFile.WriteLine olkCategory.Name & "," & olkCategory.Color & "," & olkCategory.ShortcutKey
            intCount = intCount + 1
        Next
        objFile.Close
    End If
    MsgBox "Exported " & intCount & " categories to " & vbCrLf & strFileUsed, vbInformation + vbOKOnly, CB_APPNAME & " - Export"
End Sub
 
Public Sub Import(Optional strFilename As String)
    Dim strBuffer As String, strFileUsed As String, arrValues As Variant, olkCategory As Object, intRead As Integer
    On Error Resume Next
    If bolInitialized Then
        intCount = 0
        intRead = 0
        strFileUsed = IIf(strFilename = "", strDefaultFilename, strFilename)
        If objFSO.FileExists(strFileUsed) Then
            Set objFile = objFSO.OpenTextFile(strFileUsed, ForReading)
            Do Until objFile.AtEndOfStream
                strBuffer = objFile.ReadLine
                arrValues = Split(strBuffer, ",")
                Set olkCategory = Outlook.Session.Categories.Item(arrValues(0))
                If TypeName(olkCategory) = "Nothing" Then
                    Outlook.Session.Categories.Add arrValues(0), arrValues(1), arrValues(2)
                    intCount = intCount + 1
                End If
                Set olkCategory = Nothing
                intRead = intRead + 1
            Loop
            objFile.Close
            MsgBox "Imported " & intCount & " of " & intRead & " categories read from " & vbCrLf & strFileUsed, vbInformation + vbOKOnly, CB_APPNAME & " - Import"
        Else
            MsgBox "The file " & strFileUsed & " does not exist.  Import aborted.", vbCritical + vbOKOnly, CB_APPNAME & " - Import"
        End If
    End If
    On Error GoTo 0
End Sub
 

Open in new window

How to Generate Services Revenue the Easiest Way

This Tuesday! Learn key insights about modern cyber protection services & gain practical strategies to skyrocket business:

- What it takes to build a cloud service portfolio
- How to determine which services will help your unique business grow
- Various use-cases and examples

Top Expert 2010

Commented:
This is part 2.  Follow these instructions to use it.

a.  From the menu click Tools > Macro > Visual Basic Editor or press ALT+F11 to open Outlook's Visual Basic editor.
b.  If not already expanded, expand Microsoft Office Outlook Objects.
c.  If not already expanded, expand Modules
d.  Select an existing module (e.g. Module1) by double-clicking on it or create a new module by right-clicking Modules and selecting Insert > Module.
e.  Copy the code from the snippet below and paste it into the right-hand pane of Outlook's VB Editor window
f.  Click Tools > Trust Center.
g.  Click Macro Security.
h.  Set Macro Security to Warnings for all macros.
i.  Click OK.
j.  Close Outlook.
k.  Start Outlook.

Run CategoriesExport to save the categories to a text file.  Run CategoriesImport to import the categories from that text file.  This solution will only work for Outlook 2007
Sub CategoriesExport()
    Dim objCatProcessor As New CategoryProcessor
    With objCatProcessor
        .Export InputBox("Enter the name of the file, including the path, you want to export to.", "Get Export Filename")
    End With
    Set objCatProcessor = Nothing
End Sub
 
Sub CategoriesImport()
    Dim objCatProcessor As New CategoryProcessor
    With objCatProcessor
        .Import InputBox("Enter the name of the file, including the path, you want to import from.", "Get Import Filename")
    End With
    Set objCatProcessor = Nothing
End Sub

Open in new window

Author

Commented:
The user decided to rebuild and cleanup his category list manually, before I could work with him, so I wasn't able to use the scripts. I really appreciate you posting them though. I'm quite sure they will be of great help to others!
Top Expert 2010

Commented:
You're welcome.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial