Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Outlook 如何修改AppointItem.Parent对象_Outlook_Vsto_Office Interop - Fatal编程技术网

Outlook 如何修改AppointItem.Parent对象

Outlook 如何修改AppointItem.Parent对象,outlook,vsto,office-interop,Outlook,Vsto,Office Interop,我需要从约会实例在定期约会的主机上设置UserProperty 情况是: A.用户打开定期会议/约会的实例。 B我的程序在约会系列的主机上设置UserProperty 使用父属性很容易获得主约会,但是它是只读的 我如何获得主约会的可修改引用 我想执行的代码是这样的 Outlook.AppointmentItem masterAppointment = (Outlook.AppointmentItem)(currentAppointment.Parent); masterAppointment.I

我需要从约会实例在定期约会的主机上设置UserProperty

情况是: A.用户打开定期会议/约会的实例。
B我的程序在约会系列的主机上设置UserProperty

使用父属性很容易获得主约会,但是它是只读的

我如何获得主约会的可修改引用

我想执行的代码是这样的

Outlook.AppointmentItem masterAppointment = (Outlook.AppointmentItem)(currentAppointment.Parent);
masterAppointment.ItemProperties.Add("xxx", Outlook.OlUserPropertyType.olText);
masterAppointment.ItemProperties["xxx"].Value = aStringValue;
masterAppointment.Save();

您为什么认为AppointItem.Parent返回只读AppointItem?
调用Save时是否出现错误?

如果需要添加自定义属性,请使用AppointItem.UserProperties.add.

我起初没有注意到它,但MSDN文档说明它是AppointItem上的只读属性。当我尝试在父项上添加用户权限时,我得到了一个异常:但你是对的-我在代码块中得到了一个异常,我认为是什么导致了它,但它不是。从某种意义上说,它是只读的,您无法设置它:例如,(AppointItem.parent=SomeOtherFolder)将无法工作。但从父属性返回的对象是可编辑的,除非当前用户对约会所在的文件夹具有只读访问权限。您得到的确切错误是什么?