Yes i did same. I get value for PR_TRANSPORT_MESSAGE_HEADERS and search
x_header when open item. Then get the value for x_header and remove it. It
works successfully. But when i close item i get value for
PR_TRANSPORT_MESSAGE_HEADERS and set the value of x_header which i
delete.This i do because when i open mail next time x_header should be
there. But this time the value is not set. I tried to set it in
item_close/inspector_deactivate event but value is not set. While if i debug
the program step by step the value is set. Please suggest from where i
should set it when close the item.
"Ken Slovak - [MVP - Outlook]" wrote in message
...
Well, for one thing if an email is only within an Exchange organization
that property doesn't exist. Internal emails never have a
PR_TRANSPORT_MESSAGE_HEADERS property.
That property, when it does exist, is a text property (PT_STRING8) and
there are no "subfields" in it. It's just a string. You can parse it using
string functions and find that X-header and remove it using string
functions.
--
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
"Ashish" wrote in message
...
Oh thats strange. Ok i'll do this task by different way. How to delete a
custom property from mail item.
Suppose i add a new field in mail item on exchange server and i want to
delete this field in outlook addin.
"urn:schemas:mailheader:X-MyField-Name"
IMessagePtr msgptr;
FieldsPtr Flds;
Flds = msgptr-Fields;
Flds-Item[ "urn:schemas:mailheader:X-MyField-Name" ]-Value = "field
value"
In outlook addin i can get this field and its value through
HrGetOneProp(PR_TRANSPORT_MESSAGE_HEADERS.)
If i want to delete this field then i think it's possible using
HrSetOneProp .
But HrSetOneProp takes long value as property tag to set value for any
property. I dont know the long value for
urn:schemas:mailheader:X-MyField-Name. I used outspy/mfcmapi but it
doesn't show that field.