Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


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

Posted on 2009-05-04
Medium Priority
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
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Learn how to optimize MySQL for your business need

With the increasing importance of apps & networks in both business & personal interconnections, perfor. has become one of the key metrics of successful communication. This ebook is a hands-on business-case-driven guide to understanding MySQL query parameter tuning & database perf

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
This article will help to fix the below error for MS Exchange server 2010 I. Out Of office not working II. Certificate error "name on the security certificate is invalid or does not match the name of the site" III. Make Internal URLs and External…
Viewers will learn the different options available in the Backstage view in Excel 2013.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

722 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