PropertyAccessor Outlook

时间:2014-06-24 12:34:36

标签: properties outlook

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时会出现以下异常。

有什么想法吗?

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.

1 个答案:

答案 0 :(得分:1)

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