Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Add-ins for Outlook (http://www.outlookbanter.com/add-ins-outlook/)
-   -   Change the MiniIcon in a message (http://www.outlookbanter.com/add-ins-outlook/68681-change-miniicon-message.html)

[email protected] March 16th 08 05:00 PM

Change the MiniIcon in a message
 
Hello,

I would like to change the MiniIcon of an email.

I use this code but it doesn't change it :

Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
Dim message As Outlook.MailItem =
CType(currInspector.CurrentItem, Outlook.MailItem)
message.FormDescription.Icon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCL.ICO"
message.FormDescription.MiniIcon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCS.ICO"

message.FormDescription.PublishForm(Outlook.OlForm Registry.olDefaultRegistry)
message.Save()

Could you please help me ?

Have a nice day

Regards

Ghislain

Ken Slovak - [MVP - Outlook] March 17th 08 01:44 PM

Change the MiniIcon in a message
 
Does the form have a custom message class?

If you look at an item using the form with a MAPI viewer such as OutlookSpy
(www.dimastr.com) or MFCMAPI do you see a property there PR_ICON_INDEX? If
so does it have a value of -1? You would need to set that if it's not set
to -1 and is there.

That property isn't exposed in the Outlook object model so you'd have to use
a different API such as CDO or Extended MAPI or Redemption if not using
Outlook 2007. For Outlook 2007 you can use the PropertyAccessor object with
a property tag of "http://schemas.microsoft.com/mapi/proptag/0x10800003".

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


wrote in message
...
Hello,

I would like to change the MiniIcon of an email.

I use this code but it doesn't change it :

Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
Dim message As Outlook.MailItem =
CType(currInspector.CurrentItem, Outlook.MailItem)
message.FormDescription.Icon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCL.ICO"
message.FormDescription.MiniIcon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCS.ICO"

message.FormDescription.PublishForm(Outlook.OlForm Registry.olDefaultRegistry)
message.Save()

Could you please help me ?

Have a nice day

Regards

Ghislain



Ghislain Bruyere March 17th 08 11:22 PM

Change the MiniIcon in a message
 
Thanks for all those informations

Yes I'm using Outlook 2007 but your link http://schemas.microsoft.com/mapi/proptag/0x10800003
doesn't work.

Ghislain

On 17 mar, 13:44, "Ken Slovak - [MVP - Outlook]"
wrote:
Does the form have a custom message class?

If you look at an item using the form with a MAPI viewer such as OutlookSpy
(www.dimastr.com) or MFCMAPI do you see a property there PR_ICON_INDEX? If
so does it have a value of -1? You would need to set that if it's not set
to -1 and is there.

That property isn't exposed in the Outlook object model so you'd have to use
a different API such as CDO or Extended MAPI or Redemption if not using
Outlook 2007. For Outlook 2007 you can use the PropertyAccessor object with
a property tag of "http://schemas.microsoft.com/mapi/proptag/0x10800003".

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Optionshttp://www.slovaktech.com/products.htm

wrote in message

...



Hello,


I would like tochangethe MiniIcon of anemail.


I use this code but it doesn'tchangeit :


* * * *Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
* * * *Dim message As Outlook.MailItem =
CType(currInspector.CurrentItem, Outlook.MailItem)
* * * *message.FormDescription.Icon= "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCL.ICO"
* * * *message.FormDescription.MiniIcon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCS.ICO"


message.FormDescription.PublishForm(Outlook.OlForm Registry.olDefaultRegistr*y)
* * * *message.Save()


Could you please help me ?


Have a nice day


Regards


Ghislain- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -



Ken Slovak - [MVP - Outlook] March 18th 08 01:59 PM

Change the MiniIcon in a message
 
What do you mean it doesn't work? That's the correct property tag for
PR_ICON_INDEX. That property may not be there, it's not a required property
on an item. If it's not there Outlook automatically uses the default icon
for that item type. If it's there an index value means Outlook is using one
of its standard item icons, if it's set to -1 it uses whatever icons you
specify in the FormDescription.Icon and .MiniIcon properties.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ghislain Bruyere" wrote in message
...
Thanks for all those informations

Yes I'm using Outlook 2007 but your link
http://schemas.microsoft.com/mapi/proptag/0x10800003
doesn't work.

Ghislain


Dmitry Streblechenko March 18th 08 06:20 PM

Change the MiniIcon in a message
 
That was not a link, but a DASL property name that you need to use when
calling PropertyAccessor.SetProperty

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"Ghislain Bruyere" wrote in message
...
Thanks for all those informations

Yes I'm using Outlook 2007 but your link
http://schemas.microsoft.com/mapi/proptag/0x10800003
doesn't work.

Ghislain

On 17 mar, 13:44, "Ken Slovak - [MVP - Outlook]"
wrote:
Does the form have a custom message class?

If you look at an item using the form with a MAPI viewer such as
OutlookSpy
(www.dimastr.com) or MFCMAPI do you see a property there PR_ICON_INDEX? If
so does it have a value of -1? You would need to set that if it's not set
to -1 and is there.

That property isn't exposed in the Outlook object model so you'd have to
use
a different API such as CDO or Extended MAPI or Redemption if not using
Outlook 2007. For Outlook 2007 you can use the PropertyAccessor object
with
a property tag of "http://schemas.microsoft.com/mapi/proptag/0x10800003".

--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment
Optionshttp://www.slovaktech.com/products.htm

wrote in message

...



Hello,


I would like tochangethe MiniIcon of anemail.


I use this code but it doesn'tchangeit :


Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
Dim message As Outlook.MailItem =
CType(currInspector.CurrentItem, Outlook.MailItem)
message.FormDescription.Icon= "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCL.ICO"
message.FormDescription.MiniIcon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCS.ICO"


message.FormDescription.PublishForm(Outlook.OlForm Registry.olDefaultRegistr*y)
message.Save()


Could you please help me ?


Have a nice day


Regards


Ghislain- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -




Ghislain Bruyere March 18th 08 10:21 PM

Change the MiniIcon in a message
 
It works !!!

Thank you very much.

For information, here you are my code

Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
Dim message As Outlook.MailItem = CType(currInspector.CurrentItem,
Outlook.MailItem)
message.PropertyAccessor.SetProperty("http://schemas.microsoft.com/
mapi/proptag/0x10800003", 1)
message.FormDescription.Icon = "C:\Program Files\Microsoft Office
\Office12\FORMS\1033\TASKACCL.ICO"
message.FormDescription.MiniIcon = "C:\Program Files\Microsoft Office
\Office12\FORMS\1033\TASKACCS.ICO"
message.Save()

Ghislain


On Mar 18, 6:20*pm, "Dmitry Streblechenko" wrote:
That was not a link, but a DASL property name that you need to use when
callingPropertyAccessor.SetProperty

Dmitry Streblechenko (MVP)http://www.dimastr.com/
OutlookSpy *- Outlook, CDO
and MAPI Developer Tool

"Ghislain Bruyere" wrote in message

...
Thanks for all those informations

Yes I'm using Outlook 2007 but your linkhttp://schemas.microsoft.com/mapi/proptag/0x10800003
doesn't work.

Ghislain

On 17 mar, 13:44, "Ken Slovak - [MVP - Outlook]"
wrote:



Does the form have a custom message class?


If you look at an item using the form with a MAPI viewer such as
OutlookSpy
(www.dimastr.com) or MFCMAPI do you see a property there PR_ICON_INDEX? If
so does it have a value of -1? You would need to set that if it's not set
to -1 and is there.


That property isn't exposed in the Outlook object model so you'd have to
use
a different API such as CDO or Extended MAPI or Redemption if not using
Outlook 2007. For Outlook 2007 you can use thePropertyAccessorobject
with
a property tag of "http://schemas.microsoft.com/mapi/proptag/0x10800003"..


--
Ken Slovak
[MVP - Outlook]http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment
Optionshttp://www.slovaktech.com/products.htm


wrote in message


...


Hello,


I would like tochangethe MiniIcon of anemail.


I use this code but it doesn'tchangeit :


Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
Dim message As Outlook.MailItem =
CType(currInspector.CurrentItem, Outlook.MailItem)
message.FormDescription.Icon= "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCL.ICO"
message.FormDescription.MiniIcon = "C:\Program Files\Microsoft
Office\Office12\FORMS\1033\TASKACCS.ICO"


message.FormDescription.PublishForm(Outlook.OlForm Registry.olDefaultRegistr**y)
message.Save()


Could you please help me ?


Have a nice day


Regards


Ghislain- Masquer le texte des messages précédents -


- Afficher le texte des messages précédents -- Hide quoted text -


- Show quoted text -



Ken Slovak - [MVP - Outlook] March 19th 08 03:15 PM

Change the MiniIcon in a message
 
Set PR_ICON_INDEX to -1, not 1.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Ghislain Bruyere" wrote in message
...
It works !!!

Thank you very much.

For information, here you are my code

Dim currInspector As Outlook.Inspector =
Globals.ThisAddIn.Application.ActiveInspector
Dim message As Outlook.MailItem = CType(currInspector.CurrentItem,
Outlook.MailItem)
message.PropertyAccessor.SetProperty("http://schemas.microsoft.com/
mapi/proptag/0x10800003", 1)
message.FormDescription.Icon = "C:\Program Files\Microsoft Office
\Office12\FORMS\1033\TASKACCL.ICO"
message.FormDescription.MiniIcon = "C:\Program Files\Microsoft Office
\Office12\FORMS\1033\TASKACCS.ICO"
message.Save()

Ghislain


j March 20th 08 09:25 AM

Change the MiniIcon in a message
 
Hi,

So seems like it's possible to set any icon to MailItem.

Is it possible in VSTO 2005?? For Outlook 2003???



Thanks.

Ken Slovak - [MVP - Outlook] March 20th 08 02:24 PM

Change the MiniIcon in a message
 
VSTO has nothing to do with it. Outlook 2003 doesn't have a
PropertyAccessor() object and provides no access to the PR_ICON_INDEX in the
Outlook object model. Therefore you'd have to access that property using an
alternate API. Since Extended MAPI (C++ and Delphi only) and CDO 1.21 are
both not supported for use with managed code your alternatives are MAPI
wrappers such as Redemption (www.dimastr.com/redemption) or MAPI33 or such.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"j" wrote in message
...
Hi,

So seems like it's possible to set any icon to MailItem.

Is it possible in VSTO 2005?? For Outlook 2003???



Thanks.



j March 23rd 08 08:56 AM

Change the MiniIcon in a message
 
Thanks for replay.

My AddIn developed on VSTO 2005, C#. Also i'm using Redemption
however didn't find any solution, could you please provide me some
sample regarding this.


Thanks in advance.


All times are GMT +1. The time now is 08:18 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com