How to add field in SafeMailItem's fields collection?

D

Dhananjay Pandit

Hi All,
I am developing one COM-Addin using VSTO SE / VB 2005 / Outlook 2007. I am using redemption to change some fields of mailitem. Basically I am sending mailitem using webservice & hence cancelling Application_Send event. I need to save my Sent Item (which is not sent by outlook) in one folder & want to modify some properties like sender name, sender email etc with my custom values (else those fields values comes from original sender's values).

e.g. My code snippet
' ************************************************************ *********************
Const PR_SENDER_EMAIL_ADDRESS% = &HC1F001E
Const PR_SENDER_ENTRYID%=&HC190102

SafeMailItem.Fields(PR_SENDER_EMAIL_ADDRESS)=SomeValue
SafeMailItem.Fields(PR_SENDER_ENTRYID)=SomeValue
......
.....


' ************************************************************ *********************

It is working perfectly, but on some computers I am getting error on
SafeMailItem.Fields(PR_SENDER_ENTRYID)=SomeValue

So I thought that I would check whether this field exists on that machine or not. So again I modified my code like this -
if SafeMailItem.Fields(PR_SENDER_ENTRYID) is nothing then
SafeMailItem.Fields.add(PR_SENDER_ENTRYID) <----- It gives me error
end if

In "outlook spy" I saw its type is PT_BINARY. How should I add the property PR_SENDER_ENTRYID with binary value?
Again another question is how can on some machine, Sender's entryid be nothing??!!


Thanks in advance,
 

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