Link to home
Start Free TrialLog in
Avatar of Tomster2
Tomster2Flag for United States of America

asked on

Recover Outlook 2007 (Exchange 2007) Calendar Categories

We had a problem recently and we had to create a new user profile for one user.  This user relies extensively on Calendar Categories and Colors.  With the new profile, these are all gone.

Any info on if the categories and colors are recoverable (and from where) would be greatly appreciated.

Note: I saw one post that said the categories are in the registry... but if that is the case, why would they be gone after we created the new profile?  Does that entry get overwritten when the new profile is created?
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, Tomster2.

Outlook 2007 does not store categories in the registry.  Previous version so Outlook did, but 2007 stores them in a hidden folder in the user's mailbox (Exchange) or PST file (internet mail).  The categories values (i.e. the categories assigned to a given item) are stored in the items themselves.  So, it depends on what you mean when you say you "had to create a new user profile".  If that means a new account (if on Exchange) or a new PST file (if not on Exchange), then the category info (master catergory list and colors) are gone.  
Avatar of Tomster2

ASKER

We created a new user profile on the laptop under Control Panel | Mail | profiles.  

Also, the old account on Exchange became corrupted... so a new account was created and the data (emails, tasks, calendar, contacts) were rolled into the new account.

I think you are saying that although we moved the data over, the hidden folder with the calendar categories was left behind.  Is that correct?




Yes, that's correct.
It appears MS has no utilities or functions to back up these settings preemptively.

Have you had any experience with:

http://www.vboffice.net/product.html?lang=en&cmd=detail&id=2006063

It seems to meet the need for backup and sharing of these settings.
I'm not familiar with that utility.  Saving and restoring categories is very simple from a scripting perspective.  If all you want to do is make a copy of the categories in case you need to restore them later, then you don't need the utility.  If you want the other features it offers, then that's a different matter.

Here's a script that backs up and restores categories.  The code comes in 2 parts.  This is part 1.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools > Macro > Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects
4.  Right-click on Class Modules, select Insert > Class Module
5.  In the Properties panel click on Name and enter CategoryBackup
6.  Copy the code from the Code Snippet box and paste it into the right-hand pane of Outlook's VB Editor window
7.  Edit the code as needed.  I included comments wherever something needs to or can change
8.  Click the diskette icon on the toolbar to save the changes
9.  Close the VB Editor


Option Explicit
 
'*** Constants'
Const CB_APPNAME = "CategoryBackup"
Const CB_VERSION = "1.0"
Const CB_PATH = "C:\eeTesting\Categories.bkp"   '<-- Change the path'
Const ForReading = 1
 
'*** Class Variables'
Private olkCategory As Outlook.Category, _
    objFSO As Object, _
    objFile As Object
    
Private Sub Class_Initialize()
    Set objFSO = CreateObject("Scripting.FileSystemObject")
End Sub
 
Private Sub Class_Terminate()
    Set objFSO = Nothing
End Sub
 
Public Sub Export()
    Set objFile = objFSO.CreateTextFile(CB_PATH, True)
    For Each olkCategory In Outlook.Session.Categories
        objFile.WriteLine olkCategory.Name & "," & olkCategory.Color & "," & olkCategory.ShortcutKey
    Next
    objFile.Close
End Sub
 
Public Sub Import()
    Dim strBuffer As String, arrValues As Variant
    Set objFile = objFSO.OpenTextFile(CB_PATH, ForReading)
    Do Until objFile.AtEndOfStream
        strBuffer = objFile.ReadLine
        arrValues = Split(strBuffer, ",")
        Outlook.Session.Categories.Add arrValues(0), arrValues(1), arrValues(2)
    Loop
    objFile.Close
End Sub

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Wow! Very generous of you.  Obviously you have faced this problem before.  Thank you so much for sharing.  Will post back with results... but you get the points.

Tomster2
You're welcome.  Happy to be able to help.