Properties added to MailItem in ItemSend event visible to recipien

  • Thread starter Eiríkur Fannar Torfason
  • Start date
Status
Not open for further replies.
E

Eiríkur Fannar Torfason

Hello everybody,

I have a shared add-in written in C# that will store certain custom

properties on a MailItem in the ItemSend event. I use the Redemption library

to add the custom properties.

My problem is that if the e-mail recipient is another user on the same

exchange server then these custom properties are present on the MailItem in

the recipients inbox. Is there anyway that this can be avoided while still

assigning the properties in the ItemSend event?

Here are the methods used to assign the custom properties to the MailItem.

private static void SetNamedMapiProperty(MailItem mailItem, string guid,

string propertyName, string propertyValue, bool unicode)

{

int tag = GetMapiTag(mailItem, guid, propertyName, unicode);

SafeMailItem safeMailItem = RedemptionUtils.CreateSafeMailItem(mailItem);

safeMailItem.set_Fields(tag, propertyValue);

Marshal.ReleaseComObject(safeMailItem);

}

private static int GetMapiTag(MailItem mailItem, string guid, string

propertyName, bool unicode)

{

MAPIUtils mapiUtils = RedemptionUtils.CreateMapiUtils();

int tag = mapiUtils.GetIDsFromNames(mailItem.MAPIOBJECT, guid,

propertyName, true);

if (unicode)

{

tag = tag | 0x1F;

}

else

{

tag = tag | 0x1E;

}

Marshal.ReleaseComObject(mapiUtils);

return tag;

}
 
Use a different event -- wait until the item is added to the SentItems

folder.

Sue Mosher

"Eiríkur Fannar Torfason" <EirkurFannarTorfason
wrote in message news:83DED55F-BD78-4D6C-9CBB-302F4680878D@microsoft.com...
> Hello everybody,

> I have a shared add-in written in C# that will store certain custom
> properties on a MailItem in the ItemSend event. I use the Redemption
> library
> to add the custom properties.

> My problem is that if the e-mail recipient is another user on the same
> exchange server then these custom properties are present on the MailItem
> in
> the recipients inbox. Is there anyway that this can be avoided while still
> assigning the properties in the ItemSend event?

> Here are the methods used to assign the custom properties to the MailItem.

> private static void SetNamedMapiProperty(MailItem mailItem, string guid,
> string propertyName, string propertyValue, bool unicode)
> {
> int tag = GetMapiTag(mailItem, guid, propertyName, unicode);
> SafeMailItem safeMailItem = RedemptionUtils.CreateSafeMailItem(mailItem);
> safeMailItem.set_Fields(tag, propertyValue);
> Marshal.ReleaseComObject(safeMailItem);
> }

> private static int GetMapiTag(MailItem mailItem, string guid, string
> propertyName, bool unicode)
> {
> MAPIUtils mapiUtils = RedemptionUtils.CreateMapiUtils();
> int tag = mapiUtils.GetIDsFromNames(mailItem.MAPIOBJECT, guid,
> propertyName, true);
> if (unicode)
> {
> tag = tag | 0x1F;
> }
> else
> {
> tag = tag | 0x1E;
> }
> Marshal.ReleaseComObject(mapiUtils);
> return tag;
> }
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
V Folder Properties - Gmail account can't switch Using Outlook 5
Cathy Rhone The properties of the message have been changed Using Outlook 1
U Outbox Message Stuck after reading some MailItem Properties with VBA Outlook VBA and Custom Forms 1
M OUTLOOK 2013 CONTACT PROPERTIES Using Outlook 0
Werewolf Workaround for the missing Activities tab in Contact Folder Properties in Outlook 2010? Using Outlook 2
S how to access the properties of a contact given distlist.member object Outlook VBA and Custom Forms 1
S how to set user properties to a newly created appointment Outlook VBA and Custom Forms 12
B "The properties of the message…have been changed" error Outlook VBA and Custom Forms 1
oliv- HOW TO GET PROPERTIES FOLLOW UP Outlook VBA and Custom Forms 7
O No Internet Header Properties Using Outlook 2
K how to Access Outlook Contact Properties Using Outlook 1
H Facility Mangaement using Exchange Resource Mailbox, Conflicts properties Using Outlook 5
P Changing File As Properties Using Outlook 7
B Custom Properties or Reply Outlook VBA and Custom Forms 7
A Expected behauvior when modifying properties? Outlook 2003. Outlook VBA and Custom Forms 3
T Custom Contact Forms and User Properties Outlook VBA and Custom Forms 2
K Programmatically accessing Outlook properties Outlook VBA and Custom Forms 3
P Setting combobox properties from Outlook 2007 Add-in Outlook VBA and Custom Forms 9
W Displaying custom properties of a PDF DocumentItem Outlook VBA and Custom Forms 3
E Some question if I understand user properties correct Outlook VBA and Custom Forms 3
E Some question if I understand user properties correct Outlook VBA and Custom Forms 3
E User Properties vs. Hidden attachment Outlook VBA and Custom Forms 2
E User Properties vs. Hidden attachment Outlook VBA and Custom Forms 2
M user-defined properties in printed emails? Outlook VBA and Custom Forms 8
T Propagating User Properties to Recipients Outlook VBA and Custom Forms 1
D Appointment item properties Outlook VBA and Custom Forms 5
K Accessing contact's custom properties in a Outlook 2007 form region Outlook VBA and Custom Forms 1
T Outlook custom properties Outlook VBA and Custom Forms 5
Nufc1980 Outlook "Please treat this as private label" auto added to some emails - Help. Using Outlook 4
E Edit incoming emails to remove a certain sentence added by the "system" Using Outlook 1
P Sending email from outlook IMAP to GMAIL where embedded images are added as attachment Using Outlook 1
T Junk Email does not get added to the Blocked Sender List Using Outlook 0
Horsepower Contacts added from iPhone don't show up in Outlook Using Outlook 2
F Junk Email does not get added to the Blocked Sender List Using Outlook 4
M Outlook 2013 Script Assistance - Save Opened Link with Subject Added Outlook VBA and Custom Forms 1
S newly added shared mailboxes downloading 500GB data a day Exchange Server Administration 1
O Adding a new account - "CompanyL (none)" line is added Using Outlook 5
A added new calendar, now not syncing to windows phone Using Outlook 3
M Multiple User Defined Fields that can be added, changed, updated using VBA and user form Outlook VBA and Custom Forms 0
R 2 email accounts, only 1 gets signatures added on new email. Using Outlook 1
Kristine RS box added in Favorites disappears Using Outlook 6
J DisablePST = 2 : Only Sharing-Exclusive PSTs can be added Using Outlook 1
P Outlook 2013 client not showing newly added Contacts but... Using Outlook 5
S Check if two organisition is added then i have to give managers passward creteria to send mail Using Outlook 1
S Newly added user doesn't show up in GAL but available in OWA, Using Outlook 0
O BCM 13 added leads to an outlook 13 contact subfolder BCM (Business Contact Manager) 1
Commodore Suggested Contacts by last added Using Outlook 1
S Trying to have a prompt to ask for text to be added to subject before sending. Using Outlook 3
H Automatic excel data added to Certain Emails that are received Using Outlook 3
O "Int-" prefix added to sender's address Using Outlook 4

Similar threads

Back
Top