A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Properties added to MailItem in ItemSend event visible to recipien



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 10th 09, 02:48 PM posted to microsoft.public.outlook.program_addins
Eiríkur Fannar Torfason
external usenet poster
 
Posts: 4
Default Properties added to MailItem in ItemSend event visible to recipien

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;
}
Ads
  #2  
Old November 10th 09, 04:37 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP][_4_]
external usenet poster
 
Posts: 552
Default Properties added to MailItem in ItemSend event visible to recipien

Use a different event -- wait until the item is added to the SentItems
folder.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"Eiríkur Fannar Torfason"
wrote in message ...
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;
}



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ItemSend event not firing PatrickS Outlook and VBA 2 August 4th 09 03:59 PM
ItemSend Event Catalin Outlook and VBA 4 January 17th 08 07:17 PM
move mailitem in ItemSend shubhangi Add-ins for Outlook 3 October 29th 07 02:36 PM
Cancelling and closing a mailitem in itemsend event bstrum Add-ins for Outlook 1 June 19th 07 05:53 AM
event handler for changes to TO CC and BCC properties of mailitem epsilon_9 Outlook and VBA 3 January 15th 07 03:14 PM


All times are GMT +1. The time now is 09:25 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.