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 » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

copying MAPI properties



 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old November 8th 06, 02:56 PM posted to microsoft.public.outlook.program_forms
Nikolas
external usenet poster
 
Posts: 34
Default copying MAPI properties

Hi,

I am using C# in VS 2005 and VSTO SE Beta.

My aim is to create a new MailItem that has some of the same properties of
another MailItem. Using MAPI you could do it using the IMAPIProp::CopyTo()
function and specifying which properties you wanted to copy from one MailItem
to another. Is there a way of doing this with the new Outlook object model?

Note that the new MailItem does not have all the properties of the old
MailItem. Is that an issue? I understand that some of the properties have a
read only access but still there must be a way of changing them like there is
in MAPI.

I tried using PropertyAccessor and copy each property one by one but failed.
Here is what I do:

string propertyName = "http://schemas.microsoft.com/mapi/proptag/0x0E070003"

MailItem newMailItem = this.Application.CreateItem(OlItemType.olMailItem) as
MailItem;

int value = oldMailItem.PropertyAccessor.GetProperty(propertyN ame);
newMailItem.PropertyAccessor.SetProperty(propertyN ame, value);

The last line throughs the exception. This specific property is computed
property and you cant even set it using OutlookSpy but I have some code using
(as mentioned above) IMAPIProp::CopyTo() function and does copy it to the new
message.

Any help would much appreciated.

 




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
LisstBox Properties John E. Outlook - Using Forms 1 September 20th 06 01:40 AM
Sender Properties [email protected] Outlook and VBA 4 July 6th 06 03:34 PM
Extracting Unicode MAPI properties using CDO Bertin Colpron Outlook - Using Forms 0 May 8th 06 03:28 PM
MAPI Named Properties Between Servers Overcammed Add-ins for Outlook 4 April 20th 06 03:10 PM
Calendar properties?? Sue Mosher [MVP-Outlook] Outlook - Installation 0 January 20th 06 08:09 PM


All times are GMT +1. The time now is 02:47 PM.


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.