Well now you're talking about making a pretty UI to control this thing & that's the tedious stuff.
Cos thinking up a good UI & all the weird things a user can do 2 screw it up is the hardest bit of programming...
OK, here's what I'm thinking:
Instead of categories fixed in yr code, you need to actually save yr categories to disk & give the user some UI to modify them (add, remove, edit) & also select the categories.
Seems like you basically gonna create a custom categories manager.
I'll guide you on yr way & if you have any questions just ask back here.
Here's wat I wud do
1. Save the categories using either the registry or a file. You can find lotsa VB code on the net to save settings to an xml file & that's a gud way 2 go so you can move settings between machines. Otherwise use the registry (SaveSetting / GetSetting)
2. First get it working by copying yr categories to yr file/registry & see if you can read them properly each time.
3. On Outlook shutdown, delete the custom toolbar to ensure a clean startup.
4. On Outlook startup, recreate the toolbar, then read the settings & create the buttons for each item.
5. When you read the settings, I would suggest writing them to a VB Collection - by putting the category as an Item's collection Key & also into the Tag field of the related toolbar button, you can easily track which button the user is clicking & retrieve from the collection.
6. Now that you have it working from file/registry with fixed number of categories, you'll want to create a UI so users can add/remove their own categories.
7. Just make this with a simple UserForm & a listbox, with Add, Delete, OK buttons. This will allow users to modify the categories. When the user clicks OK, you'll have 2 delete the toolbar & recreate it just like at startup so user changes are implemented. But that will just be a simple matter to call yr Shutdown & Startup code you already implemented.
8. Perhaps instead of buttons 4 each category which can get cluttered, use the dialog you made to add/remove to also set the categories by using a checked-listbox?
This would be a non-modal form, and as the user moves between different mail items - the form would just show the categories for the active mail item. The checked-listbox would be used to add/remove categories from the active item & also add/remove global categories from the list.
This could be made a pretty slick interface.
If you do this then remember that besides adding yr categories to the listbox, you must also add any existing categories from that mail item which may have come from another person.
This shud set you off in the ryt direction - any questions or other ideas just ask.