Get all categories Outlook 2010 and 2013

Add-in Express™ Support Service
That's what is more important than anything else

Get all categories Outlook 2010 and 2013
 
May Wolfgang




Posts: 8
Joined: 2013-05-09
I have one code base for Outlook 2010 and 2013. How can I get all the categories from Outlook ?
Posted 13 Dec, 2013 05:08:54 Top
Andrei Smolin


Add-in Express team


Posts: 14374
Joined: 2006-05-11
Hello Wolfgang,

I suppose that you are looking for the information in this topic:
http://social.msdn.microsoft.com/Forums/office/en-US/2ffc000c-e808-4cf6-8551-9059bdb5e457/where-exactly-does-outlook-20072010-store-the-master-category-list?forum=outlookdev

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Dec, 2013 05:26:33 Top
May Wolfgang




Posts: 8
Joined: 2013-05-09
Yes, the categories from Outlook. Can you give me a sample for this, some line of code ? (Without Redemption)
Posted 13 Dec, 2013 05:31:18 Top
Andrei Smolin


Add-in Express team


Posts: 14374
Joined: 2006-05-11
Try this one (VB.NET):

Dim cats As Outlook.Categories = OutlookApp.Session.Categories


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Dec, 2013 05:50:39 Top
May Wolfgang




Posts: 8
Joined: 2013-05-09
Ok, thank you!

But still have a problem with Outlook 2013.

In AddinModule_AddinStartupComplete() I have:

Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application(); 
            categories = app.Session.Categories;   


and the Outlook is crashing on the first line: Microsoft.Office.Interop.Outlook.Application app = new Microsoft.Office.Interop.Outlook.Application().

What I am doing wrong ?
Posted 13 Dec, 2013 05:56:22 Top
Andrei Smolin


Add-in Express team


Posts: 14374
Joined: 2006-05-11
You are not expected to call new Microsoft.Office.Interop.Outlook.Application() in an Outlook add-in. Use the OutlookApp property of the add-in module instead.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 13 Dec, 2013 06:04:18 Top
May Wolfgang




Posts: 8
Joined: 2013-05-09
Thank you very much, it works great!
Posted 13 Dec, 2013 06:35:07 Top