Group:  Microsoft Outlook ยป microsoft.public.outlook.program_addins
Thread: newmailex - messageclass change not displayed message opened

Geek News

newmailex - messageclass change not displayed message opened
"spareway" <spareway[ at ]gmail.com> 1/3/2007 9:15:39 PM
Hi,

I have a C# addin that changes the messageclass of the incoming email
message from IPM.Note to IPM.Note.ZZZ. The message class is changed
and the new icon is displayed in the message pane. But when i open the
message it displayed as an IPM.Note. If i restart outlook and open
the message, it is displayed as an IPM.Note.ZZZ.

thanks for any help.

-craig

Re: newmailex - messageclass change not displayed message opened
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 1/3/2007 9:42:00 PM
Your code needs to release the object used to make the changes, then return the item using a different object variable (HINT: Use Namespace.GetItemFromID) and display that item.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"spareway" <spareway[ at ]gmail.com> wrote in message news:1167858938.644855.219890[ at ]i12g2000cwa.googlegroups.com...
[Quoted Text]
> Hi,
>
> I have a C# addin that changes the messageclass of the incoming email
> message from IPM.Note to IPM.Note.ZZZ. The message class is changed
> and the new icon is displayed in the message pane. But when i open the
> message it displayed as an IPM.Note. If i restart outlook and open
> the message, it is displayed as an IPM.Note.ZZZ.
>
> thanks for any help.
>
> -craig
>
Re: newmailex - messageclass change not displayed message opened
"spareway" <spareway[ at ]gmail.com> 1/3/2007 10:49:35 PM

sue,

thanks for the response. I am changing the messageclass in the
NewMailEx event and i do release the object by executing:
Marshal.ReleaseComObject(mailItem);

But I still have the same behavior. Any other ideas?

thanks,

craig




On Jan 3, 4:42 pm, "Sue Mosher [MVP-Outlook]" <sue...[ at ]outlookcode.com>
wrote:
[Quoted Text]
> Your code needs to release the object used to make the changes, then return the item using a different object variable (HINT: Use Namespace.GetItemFromID) and display that item.
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
>
> "spareway" <spare...[ at ]gmail.com> wrote in messagenews:1167858938.644855.219890[ at ]i12g2000cwa.googlegroups.com...
> > Hi,
>
> > I have a C# addin that changes the messageclass of the incoming email
> > message from IPM.Note to IPM.Note.ZZZ. The message class is changed
> > and the new icon is displayed in the message pane. But when i open the
> > message it displayed as an IPM.Note. If i restart outlook and open
> > the message, it is displayed as an IPM.Note.ZZZ.
>
> > thanks for any help.
>
> > -craig- Hide quoted text -- Show quoted text -

Re: newmailex - messageclass change not displayed message opened
"Sue Mosher [MVP-Outlook]" <suemvp[ at ]outlookcode.com> 1/3/2007 10:59:03 PM
Are you opening it manually or programmatically? If the later are you returning the saved item with Namespace.GetItemFromID after releasing it?

You may need to call GC.Collect to force garbage collection to make sure the item is 100% released.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"spareway" <spareway[ at ]gmail.com> wrote in message news:1167864575.041567.94570[ at ]q40g2000cwq.googlegroups.com...
[Quoted Text]
>
> sue,
>
> thanks for the response. I am changing the messageclass in the
> NewMailEx event and i do release the object by executing:
> Marshal.ReleaseComObject(mailItem);
>
> But I still have the same behavior. Any other ideas?
>
> thanks,
>
> craig
>
>
>
>
> On Jan 3, 4:42 pm, "Sue Mosher [MVP-Outlook]" <sue...[ at ]outlookcode.com>
> wrote:
>> Your code needs to release the object used to make the changes, then return the item using a different object variable (HINT: Use Namespace.GetItemFromID) and display that item.
>>
>> "spareway" <spare...[ at ]gmail.com> wrote in messagenews:1167858938.644855.219890[ at ]i12g2000cwa.googlegroups.com...
>> > Hi,
>>
>> > I have a C# addin that changes the messageclass of the incoming email
>> > message from IPM.Note to IPM.Note.ZZZ. The message class is changed
>> > and the new icon is displayed in the message pane. But when i open the
>> > message it displayed as an IPM.Note. If i restart outlook and open
>> > the message, it is displayed as an IPM.Note.ZZZ.
>>
>> > thanks for any help.
>>
>> > -craig- Hide quoted text -- Show quoted text -
>
Re: newmailex - messageclass change not displayed message opened
"spareway" <spareway[ at ]gmail.com> 1/3/2007 11:12:11 PM
Sue,

Forcing garbage collection solved the problem.

many thanks,

craig

On Jan 3, 5:59 pm, "Sue Mosher [MVP-Outlook]" <sue...[ at ]outlookcode.com>
wrote:
[Quoted Text]
> Are you opening it manually or programmatically? If the later are you returning the saved item with Namespace.GetItemFromID after releasing it?
>
> You may need to call GC.Collect to force garbage collection to make sure the item is 100% released.
>
> --
> Sue Mosher, Outlook MVP
> Author of Configuring Microsoft Outlook 2003
> http://www.turtleflock.com/olconfig/index.htm
> and Microsoft Outlook Programming - Jumpstart for
> Administrators, Power Users, and Developers
> http://www.outlookcode.com/jumpstart.aspx
>
>
>
> "spareway" <spare...[ at ]gmail.com> wrote in messagenews:1167864575.041567.94570[ at ]q40g2000cwq.googlegroups.com...
>
> > sue,
>
> > thanks for the response. I am changing the messageclass in the
> > NewMailEx event and i do release the object by executing:
> > Marshal.ReleaseComObject(mailItem);
>
> > But I still have the same behavior. Any other ideas?
>
> > thanks,
>
> > craig
>
> > On Jan 3, 4:42 pm, "Sue Mosher [MVP-Outlook]" <sue...[ at ]outlookcode.com>
> > wrote:
> >> Your code needs to release the object used to make the changes, then return the item using a different object variable (HINT: Use Namespace.GetItemFromID) and display that item.
>
> >> "spareway" <spare...[ at ]gmail.com> wrote in messagenews:1167858938.644855.219890[ at ]i12g2000cwa.googlegroups.com...
> >> > Hi,
>
> >> > I have a C# addin that changes the messageclass of the incoming email
> >> > message from IPM.Note to IPM.Note.ZZZ. The message class is changed
> >> > and the new icon is displayed in the message pane. But when i open the
> >> > message it displayed as an IPM.Note. If i restart outlook and open
> >> > the message, it is displayed as an IPM.Note.ZZZ.
>
> >> > thanks for any help.
>
> >> > -craig- Hide quoted text -- Show quoted text -- Hide quoted text -- Show quoted text -

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net