MailItem Categories missing in action ...

G

guidoh

Just finished an Outlook COM Addin that uses the Microsoft CDO 1.21
library to create mail messages that have custom categories, which
looks like this:

Dim oMessage As Outlook.MailItem
Set oMessage = ActiveInspector.CurrentItem
oMessage.Save
MsgID = oMessage.EntryID

With oMessage
.To = SomeOnesEmailAddress
.Categories = MyCustomCategory
.Send
End With

When this message is sent to our Exchange Server running 2003 Service
Pack 1 there is another COM Addin in Exchange that recognizes the
message by its Categories and starts a custom action.

This works fine when I send the message from within our Office LAN,
however when I send a similar message from outside using SMTP the
Categories are gone by the time the message arrives within the scope of
our Exchange Server. This will probably be due to the mail format.
There is however a bigger problem when I send an message carrying
customised properties to our Exchange 2003 Server running which has
Service Pack 2 installed, the minute my message arrives the Categories
are lost.
I am hoping someone may have a solution or workaround for this problem,
unfortunately rolling back Exchange 2003 Service Pack 2 is not an
option.

Regards,

Guido
 
D

Dmitry Streblechenko

Categories and most other named props are lost if the message is converted
to MIME.
To preserve these properties (but risk the infamous winmail.dat attachment
that only Outlook can handle), you need to force the RTF format.
Set the following named property to true using Extended MAPI/CDO
1.21/Redemption:

{00062008-0000-0000-C000-000000000046}, 0x8582, PT_BOOLEAN

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

Dave Kane [MVP - Outlook]

You can pass your data in a custom transport header which won't be stripped
by Exchange whether the client is inside or outside your Exchange
organization. An internal message will retain the custom property exactly as
you wrote it. For a message arriving from outside you will find it as a
name: value pair within the PR_TRANSPORT_MESSAGE_HEADERS (0x007D001E) value.

I'm not sure you can add a field with the required property set GUID using
CDO but you can definitely do it with Redemption - Dmitry gives an example
on this page http://www.dimastr.com/redemption/objects.htm

By "COM Addin in Exchange" do you mean an event sink?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top