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.OlFormRegistry.olDefaultRegistry)
message.Save()
Could you please help me ?
Have a nice day
Regards
Ghislain
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
<ghis...@nbtconsult.com> wrote in message
news:162a0729-5a02-459f...@s12g2000prg.googlegroups.com...
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]" <kenslo...@mvps.org>
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
>
> <ghisl...@nbtconsult.com> wrote in message
>
> news:162a0729-5a02-459f...@s12g2000prg.googlegroups.com...
>
>
>
> > 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.OlFormRegistry.olDefaultRegistry)
> > 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]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"Ghislain Bruyere" <ghislain...@gmail.com> wrote in message
news:dca1c271-97f2-486e...@h11g2000prf.googlegroups.com...
Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
"Ghislain Bruyere" <ghislain...@gmail.com> wrote in message
news:dca1c271-97f2-486e...@h11g2000prf.googlegroups.com...
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" <dmi...@dimastr.com> 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" <ghislain.bruy...@gmail.com> wrote in message
>
> news:dca1c271-97f2-486e...@h11g2000prf.googlegroups.com...
> Thanks for all those informations
>
> Yes I'm using Outlook 2007 but your linkhttp://schemas.microsoft.com/mapi/proptag/0x10800003
> > - Afficher le texte des messages précédents -- Hide quoted text -
>
> - Show quoted text -
--
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" <ghislain...@gmail.com> wrote in message
news:eadd0f63-761b-45c3...@i12g2000prf.googlegroups.com...
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]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm
"j" <Evge...@gmail.com> wrote in message
news:b06128d7-92a4-4109...@n77g2000hse.googlegroups.com...
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.
Redemption.SafeMailItem safMail = new Redemption.SafeMailItem();
const int PR_ICON_INDEX = 0x10800003;
safMail.Item = myMail;
int propTag = safMail.GetIdsFromNames
safMail.SetFields(PR_ICON_INDEX, -1);
myMail.Subject = myMail.Subject; // fool Outlook into thinking something has
changed
myMail.Save();
That would set the icon index. That would be the only part where you'd have
to use Redemption code, the rest would be similar to the code Ghislain
posted.
--
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" <Evge...@gmail.com> wrote in message
news:1f499a06-4413-4c0c...@u72g2000hsf.googlegroups.com...
I tried your suggestion i wrote the same snippet (except of this line
of code: int propTag = safMail.GetIdsFromNames , i didn't understand
it's reason.)
also i added the Ghislain code, however i doesn't see the Icon.
Any suggestion??
With that code and the other code supplying the icons to use you should see
the icons unless the icon path isn't valid for your system or something else
is wrong. No errors?
--
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" <Evge...@gmail.com> wrote in message
news:bf766a48-1dc7-4bc9...@s13g2000prd.googlegroups.com...
I didn't get any error ( for test reason i provide dummy path for the
icen, and got en exception "File not found" ).
Any ideas??
Thanks in advance.
--
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" <Evge...@gmail.com> wrote in message
news:d00c2439-cd7f-483a...@a1g2000hsb.googlegroups.com...
Concerning the "File not found" i excplicitly did it, just to chech
wheterer the code is running.
I provide a right path, and don't get any exception however the icon
doesn't chenged.
Any ideas??
Thank you.
--
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" <Evge...@gmail.com> wrote in message
news:8d42891a-7cb1-459e...@i7g2000prf.googlegroups.com...
"Ken Slovak - [MVP - Outlook]" <kens...@mvps.org> wrote in message news:%23ak%23bi3jI...@TK2MSFTNGP02.phx.gbl...
> No, I have no ideas beyond what's already been discussed.
>
What do u meanby saying "The solution would be to use a published
custom form ", can explain please, or provide
some sample???
Another question, the AddIn developed for Outlook 2003 on VSTO 2005,
C# 2.0, also the AddIn works fine in Outlook 2007
the " Outlook 2007, a form region manifest", can be used in my
situation??? (I'm using Redemption in my code.)
Thanks in advance.
Form regions are for Outlook 2007 only.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54
"j" <Evge...@gmail.com> wrote in message news:203ab6d0-5ced-4597...@y21g2000hsf.googlegroups.com...
Can i do the same (change icon) on mailItem, without creating a
message form???
Thanks in advance.
"j" <Evge...@gmail.com> wrote in message news:7dada738-8488-4ed2...@i12g2000prf.googlegroups.com...