The MAPI properties that make an item an one-off form instance certainly should be removable with Redemption.
--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
"Nikolas" wrote in message ...
I need to delete the one-off properties from the message that was sent from
Outlook 2003. These properties dont let Outlook 2007 use a form region to
open the message.
Is there a reason why I could not possibly delete a property even with
Redemption? Is there a concept of read only properties?
"Sue Mosher [MVP-Outlook]" wrote:
Sorry, but I have no expertise in writing C#, only VB/VBA and VBScript.
Why do you need to get rid of the property? I don't see how that would affect the use of a form region.
"Nikolas" wrote in message news
Hi Sue, thanks for your response. I'll continue this post here since you got
my attention and is quite urgent to us.
Here is my code trying to delete the property using Redemption:
Type type = Type.GetTypeFromProgID("zetadocsCdo.SafeMailItem") ;
Redemption.SafeMailItem safeMailItem =
(Redemption.SafeMailItem)Activator.CreateInstance( type);
safeMailItem.AuthKey = "MYKEY";
safeMailItem.Item = mailItem; //the selected item
safeMailItem.set_Fields((Int32)0x80F30003/*85420003*/, 0);
mailItem.Save();
This particular mail item created in Outlook '03 and we want to get rid of
this property (along with others) in order to be able to open it with a form
region in Outlook '07. The strange thing is that if that property doesnt
exist on the mail item then its value is set to 0. If it does exist then its
value does not change.
Also:
long val = (long)safeMailItem.get_Fields(85420003); //fails with exception:
object reference not set to an instance of an object
and:
long val = (long)safeMailItem.get_Fields((Int32)0x80F30003); //does not
compile. Invalid cast
"Sue Mosher [MVP-Outlook]" wrote:
MAPI properties intrinsic to Outlook can't be deleted with PropertyAccessor. Consider using Redemption instead.
Still the wrong section, BTW. The program_addins and program_vba newsgroups are more appropriate for this type of coding question.
"Nikolas" wrote in message ...
Hi,
Im using VSTO '05 SE with Visual studio '05 on C# to create an add-in for
Outlook '07. I'm trying to delete a property of a mail item using the
PropertyAccessor but I get the following exception:
[System.UnauthorizedAccessException] = {"The property
\"http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/85420003\" does not support this operation."}
Is there a way of deleting this property?
PS. I apologise for posting this question a 2nd time, it was posted on the
wrong section the 1st time.