C#以编程方式添加新的和更新现有的用户定义字段:教程? [英] C# Adding new and updating existing user-defined fields programatically: tutorial?

查看:95
本文介绍了C#以编程方式添加新的和更新现有的用户定义字段:教程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我被要求增加现有Outlook"连接器"的功能。

I've been asked to increase the functionality in an existing Outlook 'Connector'.

当前的方法是使用固定的用户定义字段。

The current approach is to use fixed user-defined fields.

我需要更改此项以动态添加用户定义的字段,然后更新每个字段的值。

I need to change this to add user-defined fields dynamically and then update values for each field.

请告知显示如何添加/更改Outlook约会用户定义字段的教程。 

Please advise tutorials that show how to do add/change Outlook appointment user defined fields. 

非常感谢

Stew

推荐答案

Hello Stew,

Hello Stew,

您可以通过调用  UserProperties.Add   Outlook项目或文件夹的方法,或 UserDefinedProperties。添加   遇到hod
是一个文件夹。

You can define custom properties by calling either the UserProperties.Add method for an Outlook item or folder, or theUserDefinedProperties.Add method for a folder.

你可以创建一个由定义的类型的属性  ; OlUserPropertyType   枚举,
除以下类型外:  olEnumeration   olOutlookInternal
  olSmartFrom

You can create a property of a type that is defined by the OlUserPropertyType enumeration, except for the following types: olEnumeration, olOutlookInternal, and olSmartFrom.

要首次设置由  UserProperties.Add   方法,使用  UserProperty.Value   属性
而不是  SetProperties     SetProperty   方法  PropertyAccessor   对象。

To set for the first time a property created by the UserProperties.Add method, use the UserProperty.Value property instead of the SetProperties and SetProperty methods of the PropertyAccessor object.

例如,下面列出了一个VBA示例代码:

For example, a VBA sample code is listed below:

Sub AddUserProperty() 
 Dim myItem As Outlook.ContactItem 
 Dim myUserProperty As Outlook.UserProperty 
 
 Set myItem = Application.CreateItem(olContactItem) 
 Set myUserProperty = myItem.UserProperties _ 
 .Add("Details", olText) 
 myUserProperty.Value = "Neighbor" 
 myItem.Display 
End Sub






这篇关于C#以编程方式添加新的和更新现有的用户定义字段:教程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆