Changing Icon of message class

  • Thread starter Thread starter Tobias Böhm
  • Start date Start date
T

Tobias Böhm

Hello,

here's what I want to do. My AddIn is creating outlook-folders at
runtime. One for mail one for tasks and another one for tasks. The
items of the last task folder should have a different icon (can be one
of the available outlook-icons).

I found
http://groups.google.com/group/micr...lnk=gst&q=message+class+icon#57d7d93a561a3a07
and did what Sue Mosher suggested. I created a Form, published it,
changed the MessageClass of an item, which then used the new form but
the icon didn't change. Furthermore, the MessageClass of that item was
reset after restarting outlook.

I fifured that I had to change the default class items in that folder
get when created. Also I can't change the Default message class of a
folder. I can change the PR_DEF_MSG_CLASS property via MAPI which
according to OutlookSpy works. But OutlookSpy also says that the
DefaultMessageClass property of the TaskITem property hasn't changed.

I think I'm missing something here. What is the simplest way to
achieve what I want to achieve?

Thanks,
Tobi
 
When you publish a form of any base MessageClass it will use the Post icon
unless you explicitly change the icon in the Properties tab of the form when
it's in design mode. You need to change both the large and small icons for
that new custom MessageClass before you publish the form. At that time you
also should set the Version string property and increment or change it for
every published change you make to the form to avoid forms cache corruption.

After that any item that uses that custom MessageClass will use the icons
you set for that MessageClass.

The default class of a folder is always an intrinsic Outlook item type, such
as PR_CONTAINER_CLASS == IPF.Task for all task type folders.

The PR_DEF_POST_MSGCLASS property can be changed to alter what MessageClass
is used when a new item is created in that folder. That has a property tag
of 0x36E5001E or in DASL syntax it's
"http://schemas.microsoft.com/mapi/proptag/0x36E5001E". If you want new
items created using your custom MessageClass you would set or create that
property to the custom MessageClass name string.

Any icon can be used (large and small) as long as they meet the requirements
for the form icons (16x16 for large icons and 32x32 for small ones).
 
Back
Top