2014-06-24 84 views
1
PropertyAccessor opa = outlookitem.PropertyAccessor; 
opa.SetProperty("http://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/Id", "100"); 
var val = opa.GetProperty("http://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/Id"); 

当我在我自己的日历(outlookitem)在我的日历中创建它时,它工作正常。但是,当我添加一个同事日历到我的Outlook尝试它时,我得到以下异常,当调用GetProperty。PropertyAccessor Outlook

任何想法?

An exception of type 'System.Runtime.InteropServices.COMException' occurred in *** but was not handled in user code 

Additional information: The property "http://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/Id" is unknown or cannot be found. 
+0

这是你的实际代码吗?你真的设置并立即读回财产?还是有电话间隔? –

+0

有一个间隔,它给出了相同的错误。这仅用于测试 – hippie

+0

是否有可能在第二个代码段运行之前重新创建预约?如果Outlook收到会议更新,则可能发生这种情况。 –

回答

1

必须在访问该属性之前保存该项目。不行。谢谢