posted on Friday October 3, 2008 - 4:59 pm (1 month, 2 weeks ago)
tags , , ,

Microsoft Outlook can be a great collaborative program, but sometimes it seems to lack features that you think would be no-brainers. For instance, there is no easy way (that I can find) to create categories globally for all users. Obviously, you wouldn’t want to force users into using categories but in some instances it can be useful to have everyone’s “meeting” category with the same name and (probably more importantly) colour which appears in the calendar.

There are two ways to give everyone in a work group the same categories. The first is to set them up on one copy of Outlook, and export the registry keys. These keys are imported for all users. The problem here is that the keys will overwrite any other customisations.

The second way is to use the Windows Scripting Host to connect to a local instance of Outlook and create the categories. Let’s walk through how we’ll do this. Note that this has only been tested with Outlook 2007, but does not require Administrative privileges to run.

First, create an Outlook object and a connection to that object’s MAPI interface:

Dim oOutlook : Set oOutlook = CreateObject("Outlook.Application")
Dim oNameSpace : Set oNameSpace = oOutlook.GetNameSpace("MAPI")

Next, use the MAPI interface to create a new category:

oNameSpace.Categories.Add "Our category", 1, 2

Where the first number is a number between 1 and 25 and the second is between 2 and 12 (more on these later). The first number denotes the category’s colour and the second denotes the shortcut key.

Pretty simple, but you probably want something more robust that you could use in a login script to ensure all users get the same categories. A robust solution should check if the category exists so you don’t tread on anyone’s toes.

Function categoryExists(categoryName)
	Set theCategories = oNameSpace.Categories
	For Each theCategory in theCategories
		If theCategory.Name = categoryName Then
			categoryExists = True
			Exit Function
		End If
	Next
	categoryExists = False
End Function

This function loops through all of the categories and returns True if the category submitted to the function exists. To use the function, we might expand our earlier line into the following:

If Not categoryExists(catName) Then
	oNameSpace.Categories.Add catName, catColour, catShortcut
	WScript.StdOut.Writeline "Added '" & catName & "' into Outlook."
Else
	WScript.StdOut.Writeline "'" & catName & "' already exists in Outlook. Not adding."
End If

Before I mentioned integrating category creation into a login script. To do this, you want to allow people to pass categories in at the command line:

catName = WScript.Arguments.Item(0)
catColour = WScript.Arguments.Item(1)
catShortcut = WScript.Arguments.Item(2)

You can view the list of colours and shortcuts on Microsoft’s MSDN site.

Putting everything together, and we have a script which you can call from the command line using the following command:

cscript /nologo addOutlookCategory.vbs "Hello World" 4 7

This will create a new category named Hello World, which has a corresponding yellow colour, and can be set by pressing CTRL-F7.

Download the entire script for yourself:

If you find this script useful, please drop me a line in the comments below.

No comments, make a comment »
posted on Tuesday July 19, 2005 - 1:06 pm (3 years, 4 months ago)
tags ,

I’ve always considered Visual Basic .NET to be more effort than it’s predecessor — Visual Basic 6 — even to get the same results. In some ways it is, but once you’re used to it, it’s not much more difficult.

There are some great features in that either weren’t present in Visual Studio 6 or I simply missed them. Being able to sort a one-dimensional array by writing myArray.Sort(myArray) rather than writing 5 or 10 lines of code to achieve the same thing using the ever-dependable (though probably a just as fast, once it’s compiled) bubble sort method. I’d bet the .sort method does it’s own internal bubble sort.

The other interesting feature is how easy it is to read/write to the registry. Granted, this in-built method is rather limited (you can’t modify anything outside the application’s own path) but it is very useful. You can write to any part of the registry using a custom-written subroutine/function but it’s a lot more cumbersome, and most applications don’t need that functionality. You can read from the registry as easily as this: myVariable = GetSetting(Application.Name, “SomeKey”, “KeyUnderSomeKey”, “DefaultIfNoValue”). Much easier than writing 20 lines of code!

And that’s all I have to say about that, for now.

No comments, make a comment »
posted on Friday July 8, 2005 - 6:06 pm (3 years, 4 months ago)
tags , ,

The thing I miss most while being a boss is coding. Whether it’s ASP, PHP, VB, plain ol’ HTML or something else, I miss the fun of building stuff.

Since today was pretty quiet, I took it upon myself to do some ASP coding… and enjoyed myself very much. I was tweaking and integrating some parts of contractor system that was released over a year ago; the system is very separated with two distinct sections. It’s been something I’ve wanted to do for ages and it’s not done yet, but the whole two systems look much more like the one system.

Not only that, I cleaned up a lot of the ugly HTML and CSS code today — there’s a lot more to go, however. Eventually I want to tackle most of the bad ASP code too. I’d love to clean up the database’s design but that’s probably not going happen any time soon, since it’s so heavily used.

‘Twas a fun day, even though it was still work.

No comments, make a comment »
posted on Wednesday April 6, 2005 - 8:17 pm (3 years, 7 months ago)
tags , ,

I’ve been wanting to do it for a while, so I spent a little bit of time tonight getting it right. The dropdown to select the stylesheet has been stripped of the crappy old stylesheets I don’t like any more. If, for some reason, you’re still using one of those, I have no idea what will happen.

Also, if you click on any of the stylesheets, it no longer automatically saves it, but simply switches the page to that particular stylesheet. The stylesheet is only saved if you click (shock) “save”. If you don’t have one saved, a random one will be selected next time you load a page.

Lastly, you are now able to delete the selection of permanent stylesheet by choosing the “unsave selection” option. This will result in a random one being selected next time. The only exception to this rule is when there are special stylesheets (such as Christmas, etc); then you don’t get a choice.

Minor things, yes, but it’s been bugging me for a while.

No comments, make a comment »
posted on Monday July 5, 2004 - 5:53 pm (4 years, 4 months ago)
tags , ,

I have added a search function to the site, since I was trying to find an old post and couldn’t remember when it was posted. There are currently around 180 posts on this site and as more are added it will become more difficult to remember when I posted things.

Well, the search function will alleviate that. Just type what you’re after (it’s a case-insensitive “LIKE” search, so searching for “potter” will, for example, find “Harry Potter” or “Spottered dogs”) and it will try it’s best to find it.

No comments, make a comment »
posted on Tuesday May 11, 2004 - 6:27 pm (4 years, 6 months ago)
tags , , , ,

I am still working on a rather large project at work (detailed here) and am making pretty good progress on said project. For those who care about technicalities, a Visual Basic app talks to an ASP server using XML. The ASP server then discusses with a Microsoft SQL server the possibility of storing and retreiving records. There’s more to it than that, but that’s the basic gist of it.

At the start of last week, once I returned from ITIL Training, I was asked (asked is such a nice word for what really happened) to ensure that the project was ready for testing at 9am sharp on Monday 24th May. Essentially this means it needs to be ready on Friday 21st May (unless I feel like working all that weekend in the office, which I don’t).

Now, based on the progress I am currently making, I think the project (which entails the stuff I mentioned before, but from the user’s points of view, 2 Visual Basic apps and a website) should be ready for testing. They want to test it for a week (originally they allotted only one day of testing; ha!) which I still think is too short but will have to do.

This morning, I was again asked to ensure that our entire Division’s website (it’s not my design, let’s just make that clear) reflects the new university-wide templates by the end of June. I just checked, and on the website, there are over 1,100 files with either .php or .htm(l) as their extension. This means they probably all need to be changed. I have already created a number of different samples we could use but they haven’t even decided what they want it all to look like. I’ll be getting help from the new guy — Richard — as well so that will help a fair bit. Still, we have over 500 pages each to change in a month. Now, I had been under the impression since around October that I we wouldn’t have to be responsible for this, since we already have enough bloody work to do. The powers that be have now decided that not only do they want us to do it, but they want it done now, as opposed to October/November when it had originally scheduled to be rolled-out. This is in addition to everything else we need to do.

It was nice of my boss — Glenn — to offer me to take as much overtime as I need to get both of these projects done but I would really prefer to have a light workload than have authority to take any overtime I want. At least count, there are another 23 IT-related projects people want us to complete by the end of the year; there are two of us (myself and Richard) providing support for over 120 users across five sites at the same time.

Hence the “Hooo boy” title for this post. Eep.

No comments, make a comment »
posted on Thursday January 22, 2004 - 11:48 am (4 years, 10 months ago)
tags , ,

Someone has just come up to me to talk about a project I’m working on for them. This project is basically going to bring a few paper-based procedures into one computerised set of procedures.

The procedures include external contractor management, sign in and sign out of contractors, induction of contractors and their employees, and a few other bits and pieces.

Now, there’s one problem that I always encounter when turning paper-based procedures/processes into electronic ones.

The problem is that the users never actually know what they want. My brief for this project was “We want to record sign in and sign outs on a computer”. Well gee, great brief guys. Why don’t you just use Microsoft Excel to store it?

OK, so, as usual, I’m trying to second-guess what people actually want. Instead of getting a nice document (hell, even an email outlining what they actually want for reference would be nice) I have to go and research the existing processes myself.

Now, I’ve been given an unrealistic deadline to have this project out the door. Firstly, they want it “fully up and running next week”. OK, what does “fully” mean? Secondly, they want it tested and bug-checked and then “rolled out” within two more weeks. Two weeks is hardly enough to test, let alone test, find bugs, and resolve bugs. Good luck.

Not only that, but software/web development is only one part of what I’m employed to do (technically, I’m not even employed to develop software; yes, I’ve already asked, I’m not getting a raise). I have to support the other users, update our website, and manage the servers here too. Ugh.

So, in conclusion, I am developing software by the seat-of-my-pants, with no guidelines or requests for features, while juggling three other duties as well.

I used to think this was the best way to go about things (because I didn’t get bugged about certain features in programs, etc), but now I can see the value in scope documents, and written guidelines. I will be asking for clear, concise documentation from now on, and will be ONLY developing those features into programs.

You want extra functionality? Get to the back of the line, buster.

No comments, make a comment »
 
bludger.org (version 9) © 2000-2008 bludger.org. All rights reserved.
Not many animals were harmed in the making of bludger.org, but a lot were eaten. And they were delicious.
I mean, really, really nice. I especially liked the squab, he didn't put up a fight.