Creation of public categories for all end users of outlook 2007 calendars

Posted on 2009-05-04
Last Modified: 2012-05-06
Having a little issue with Microsoft Office 2007 and calendars.

We would like to deploy globally to all outlook clients the same Categories (custom color & labels) so that when users are editing public calendars they can quickly determine what the appointment pertains to.  Our public calendars are very large and at a month glance could have 100's of entries.

I am to understand in Outlook 2003 a simple registry hack was possible.  However the registry setting for 07' no longer exist; I have looked in to software packages however we do not want to deploy yet another package to these machines and maintain the package.

I am assuming I am going to have to write an add-in, or some kind of .net program to hit a network share and pull the categories into each users calendar.

My question is, has anyone else done this or know of any way to get this accomplished?  Would powershell be a viable solution to something like this?  I am really in a world I do not understand when it comes to customizing the MS Office Suite.  I have no problem writing C#; although most of my exp with programming is in obj-c and python.

Thank you in advance
Question by:bcpa
  • 3
  • 2
LVL 76

Expert Comment

by:David Lee
ID: 24302679
Hi, bcpa.

"I am assuming I am going to have to write an add-in, or some kind of .net program to hit a network share and pull the categories into each users calendar."
Your assumption is correct.  An add-in would be best, but you could do it with an external program.

"Would powershell be a viable solution to something like this? "
I don't know enough about PowerShell to be able to answer the question.  You could do it with VBScript, so it might be possible with PowerShell.  

"My question is, has anyone else done this or know of any way to get this accomplished?"
The answer to both questions is "yes".  I can demonstrate how to do this using VBScript, VBA, and possibly  I don't know C#, objc, or Python, so I can't provide any examples in those languages.  If you can read VB, then you can probably translate the solution into C#.  I can't say that for certain though since I don't do C#.  

There have been a couple of questions lately about using standard categories.  I've been thinking about developing a solution that uses a web service like approach.  This would require putting a page on a web server that returned an XML document listing the categories, their names and colors.  The client piece would poll the web service at a set interval, download the XML, and ensure that the local machine has matching categories.  A simpler approach would be to add some VBScript to a login script that'd update the categories each time the user logged in.  The downside I see to that is that an employee could change them immediately after each login.  With the service approach checking say once an hour I doubt a user would want to change categories 8 times a day.  

Let me know what you think.  I can demo a scripted approach in very short order.  A service approach will take a few days for me to put together.

Author Comment

ID: 24306666
Running a web service from a local server had not even crossed my mind.  That sounds like a good approach, does Office 2007 have the capability to read the file as an XML file versus a flat text file?

We generally try to avoid login scripts, we use Desktop Authority for a majority of our desktop customization at login.  However if you have a solution in VBScript I would like to see it and see if I can't build off that as an example.  Although I do not personally use VB I am sure I could translate it quite easily, I would post the translation up in C#.  My reasoning for use of C# is only due to my lack of knowledge with VB.

I would be interested to see what you come up with in regards to the web service, in terms of the .net service I will toy with some ideas; however I have very limited knowledge in regards to  the interfacing needed to communicate with Office 2007... I will have to do some research.

Thank you for your reply and I am interested in finding out what we can come up with, this is an issue that should have been addressed by MS.  I did notice there is a GPO for adding custom labels however I have not been able to get it to work; also there is no way to define colors which plays a key role in this particular situation for us.

LVL 76

Accepted Solution

David Lee earned 500 total points
ID: 24321371
"Office 2007 have the capability to read the file as an XML file versus a flat text file"
Sure.  Just requires a little scripting.  

"My reasoning for use of C# is only due to my lack of knowledge with VB."
Which is exactly the reason I can't post a solution in C#.

Here's my VBScript solution.  This compares a list of categories and colors to the user's list of categories and colors.  If a category doesn't exist the script creates it.  If the category does exist but doesn't have the right color, then the script resets the color.  
Const CATNAMES = "CatA,Business"
Const CATCOLORS = "2,3"
Dim olkApp, olkSes, olkCats, olkCat, arrCats, varCat, arrColors, varColor, intIndex
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
olkSes.Logon "Outlook"
Set olkCats = olkSes.Categories
arrCats = Split(CATNAMES, ",")
arrColors = Split(CATCOLORS, ",")
For intIndex = LBound(arrCats) To UBound(arrCats)
    varCat = arrCats(intIndex)
    varColor = arrColors(intIndex)
    Set olkCat = olkCats.Item(varCat)
    If TypeName(olkCat) = "Nothing" Then
        Set olkCat = olkCats.Add(varCat, varColor)
        If olkCat.Color <> varColor Then
            olkCat.Color = varColor
        End If
    End If
Set olkCat = Nothing
Set olkCats = Nothing
Set olkSes = Nothing
Set olkApp = Nothing

Open in new window


Author Comment

ID: 24325766
I will work off this thank you for your help; if you decide to come up with a web service based solution I would be interested in seeing your results.

Thanks much
LVL 76

Expert Comment

by:David Lee
ID: 24325812
You're welcome.  Glad I could help.  I will put the web service idea together as soon as I can and will post it here or let you know where to find it when it's done.

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Viewers will learn how to maximize accessibility options in an Excel workbook for users with accessibility issues.
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

762 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