Re: Programatically changing an Outlook folder icon

7 views
Skip to first unread message

Sue Mosher [MVP-Outlook]

unread,
Jul 3, 2007, 7:43:34 AM7/3/07
to
That's not possible. Outlook provides no extensibility for the folder list. The only place you can change an icon is in the SHortcuts pane, which hardly anyone uses.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Raymond Brink" <br...@collexis.com> wrote in message news:77A5F8E6-28B1-4628...@microsoft.com...
> Hi,
>
> Can someone please explain to me how I can change an Outlook folder icon
> programmatically? An example in either VB.NET of C# would be very much
> appreciated.
>
> Thanks in advance!
>
> Raymond
>

Raymond Brink

unread,
Jul 3, 2007, 8:05:56 AM7/3/07
to
Thanks for the quick response. How unfortunate...

Any other ideas on how to mark a folder visibly for a user as a 'special'
folder? Change it's text color/style? Is that possible?

Best regards,
Raymond

"Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
news:eBCkrdWv...@TK2MSFTNGP02.phx.gbl...

Sue Mosher [MVP-Outlook]

unread,
Jul 3, 2007, 8:44:31 AM7/3/07
to
Repeating: the folder list display is not extensible. There is nothing that you can do in the folder list to distinguish one folder from another of the same type.

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Raymond Brink" <br...@collexis.com> wrote in message news:6155B46F-C80F-459F...@microsoft.com...


> Thanks for the quick response. How unfortunate...
>
> Any other ideas on how to mark a folder visibly for a user as a 'special'
> folder? Change it's text color/style? Is that possible?
>
> Best regards,
> Raymond
>
> "Sue Mosher [MVP-Outlook]" <sue...@outlookcode.com> wrote in message
> news:eBCkrdWv...@TK2MSFTNGP02.phx.gbl...
> That's not possible. Outlook provides no extensibility for the folder list.
> The only place you can change an icon is in the SHortcuts pane, which hardly
> anyone uses.
>

dot smolin @add-in-expressdotcom Andrei Smolin

unread,
Jul 7, 2007, 9:18:22 AM7/7/07
to
Hi Raymond,

For this folder only, you can show: a custom command bar, a custom task
pane, a custom form embedded into the Explorer window
(http://www.add-in-express.com/outlook-extension/), a custom form in the web
view (i.e. instead of item list - see the same link).

In some scenarios, just naming the folder in some special way is enough.

Regards from Belarus,

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com


"Raymond Brink" <br...@collexis.com> wrote in message

news:6155B46F-C80F-459F...@microsoft.com...

Raymond Brink

unread,
Jul 10, 2007, 2:34:37 AM7/10/07
to
Hi Andrei,

As I'm considering buying your add-in express product anyway, I might just
as well point this question directly to you. What 'scenarios' are you
talking about? Would any of those scenarios allow me to change a folder icon
to my own custom icon? I did receive a suggestion (below), but unfortunately
I'm not a hardcode C++ programmer. I recon you are? Wouldn't this be
something interesting to introduce in your product anyway? :-)

Best regards,
Raymond

-------------------------
Hi Raymond,

Sue is right - there is no API to do this (which means that it's not
possible - at least not by the rules).

I've done a lot of Outlook development and I've tried doing something like
this myself.

Mail items you can do easily by having different forms with different icons.

Then to change the icon you change the form (which gives the appearance of
changing the icon) - easy ! This is as far as I went because we didn't need
to change folder icons - just the icons for the mail items.

Now folders ... urgh ... much harder. if you wrote your own store provider
you could probably do this but not if you intend to use the standard mailbox
and PSTs etc.

I suppose if you're really keen and (if you're a hardcore C/C++ and Extended
MAPI programmer rather than a VB and "Redemption" type then) if you wanted
to try ...

- You could traverse the window list to the tree control then attempt to
swap in your own icon for the folder in question but this is technically a
little tricky and you'd be lucky if it worked without side effects.

or

- Or you could use a system hook on the tree control to either paint over
the icon in the color you want or to intercept the control's paint calls and
tweak them to suit.

Of course with either of these you'd need a explorer container event handler
so that you could handle additional explorers being opened (and closed).

Cheers,

Scott Quinn

-------------------------

"Andrei Smolin" <andrei dot smolin @ add-in-express dotcom> wrote in message
news:OmGuNkJw...@TK2MSFTNGP04.phx.gbl...

Raymond Brink

unread,
Jul 10, 2007, 2:37:07 AM7/10/07
to
Hi Andrei,

As I'm considering buying your add-in express product anyway, so I might

Best regards,
Raymond

-------------------------
Hi Raymond,

or

Cheers,
Scott Quinn

-------------------------

dot smolin @add-in-expressdotcom Andrei Smolin

unread,
Jul 17, 2007, 7:39:37 AM7/17/07
to
Hi Raymond,

Sorry for the delay.

For some users, naming the folder as "My SUPERDUPER Folder!!!!!!!!" will be
enough.

No, it isn't possible to change the folder icon in a simple way. The more
complex way, as follows from Scott's suggestions, requires you to subclass
the folder tree window, to decipher the window messages and after, say the
Paint message, to draw your icon on this window. This can be implemented
with no or little problems. However, the biggest problem is detecting the
point where the icon should be drawn. This requires a lot of time: the
folder list can be scrolled in all directions, it can be affected by the
current Windows/Office schema and font size, and there may be other issues I
am not aware of.

I think this solution will be rather expensive.

Regards from Belarus,

Andrei Smolin

Add-in Express Team Leader


Regards from Belarus,

Andrei Smolin
Add-in Express Team Leader
www.add-in-express.com


"Raymond Brink" <br...@collexis.com> wrote in message

news:88873B54-BB24-4E68...@microsoft.com...

Reply all
Reply to author
Forward
0 new messages