View Single Post
  #2  
Old February 23rd 06, 01:26 PM posted to microsoft.public.outlook.program_addins
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Handling Outlook COM exceptions in .Net

You may be running up against any or all of these three issues with Restrict:

1) You can use Find and Restrict with custom fields only if those fields have been defined in the folder, not just in individual items. A good test is whether a folder view can show the data in those fields from the User-defined Fields in Folder list of fields.

2) The proper syntax for the field name is to enclose it in square brackets; you have only an open bracket, not a closing bracket.

3) The date element must be enclosed in text quotes, not date quotes and definitely not both kinds of quotes, which is how you have it.

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


wrote in message oups.com...
Hi,

I has anybody encountered the following behaviour:
COM exception thrown from Outlook, when handled in .Net,
has different HRESULT every time, for the same error..

E.g.
I cause an exception by using a wrong filter in restrict (adding ZZZ)


Outlook.Items inboxItemsCollection;
inboxItemsCollection.Restrict("[ReceivedTimeZZZ = '#2/23/2006
14:18#'")

I get exception:
"The property "ReceivedTimeZZZ" is unknown."

The value in class System.Runtime.InteropServices.COMException
of ErrorCode is -1317928951

and in another call it will be
ErrorCode -1005453303

on every call (exception), ErrorCode will get a different value.


Is this a known problem ? in Outlook ? Interop ?
It occurs on various methods, not just Restrict.

It is also discussed he
http://groups.google.com/group/micro...a91332ac0e89f3


Thanks for any help.
Si.

Ads