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

delete property



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old February 26th 07, 11:58 AM posted to microsoft.public.outlook.program_forms
Nikolas
external usenet poster
 
Posts: 34
Default delete property

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.

  #2  
Old February 26th 07, 03:35 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default delete property

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.
--
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 ...
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.

  #3  
Old February 26th 07, 05:08 PM posted to microsoft.public.outlook.program_forms
Nikolas
external usenet poster
 
Posts: 34
Default delete property

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.
--
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 ...
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.


  #4  
Old February 26th 07, 05:18 PM posted to microsoft.public.outlook.program_forms
Nikolas
external usenet poster
 
Posts: 34
Default delete property

Correction:
long val = (long)safeMailItem.get_Fields((Int32)0x80F30003); //it does
compile. But runtime error: Specified cast is not valid


"Nikolas" wrote:

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.
--
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 ...
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.


  #5  
Old February 26th 07, 07:59 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default delete property

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.
--
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 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.


  #6  
Old February 27th 07, 11:16 AM posted to microsoft.public.outlook.program_forms
Nikolas
external usenet poster
 
Posts: 34
Default delete property

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.
--
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 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.



  #7  
Old February 27th 07, 04:44 PM posted to microsoft.public.outlook.program_forms
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default delete property

Since Sue isn't a C# programmer, pardon me for jumping in here.

Never just use a property tag in the 0x80000000 range, it can vary from mail
store to mail store and from store provider to store provider. That
reference you are using to Fields(0x80F30003) is not correct.

For a PT_LONG property like the one you are trying to access in that
namespace you should get the property tag on the fly by using the
SafeMailItem.GetIDsFromNames() method. That returns a 32-bit int and you
then OR that result with the value for PT_LONG (0x0003).

In this case the retrieval of a valid property tag for that property would
look like this:

const int PT_LONG = 0x0003;
int tag =
safeMailItem.GetNamesFromIDs("{00062008-0000-0000-C000-000000000046}",
0x8542) | PT_LONG;

You can then retrieve that property.

If you want to remove it set it to empty.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"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.
--
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


  #8  
Old February 27th 07, 03:32 PM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default delete property

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.



 




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
Sent or Recieved Email Property Irene Outlook and VBA 1 February 2nd 07 09:31 PM
Picture-Property outside an application not possible? Peter Marchert Outlook and VBA 0 September 28th 06 10:41 AM
MailItem To property and display name Olivier Langlois Outlook and VBA 1 September 11th 06 06:10 PM
MessageClass Property of a Post Geoff Outlook and VBA 13 June 27th 06 09:49 AM
How to change InternetCodepage property? Konstantin Sokolovskiy Outlook - General Queries 0 June 21st 06 01:17 PM


All times are GMT +1. The time now is 07:07 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.