使用EWS将新的Outlook联系人添加到自动填充功能?

时间:2021-01-18 15:43:01

I successfully added a new Contact to a users Outlook address book using the following code:

我使用以下代码成功地将新联系人添加到用户Outlook通讯簿:

Contact contact = new Contact(_service);
contact.GivenName = firstName;
contact.Surname = lastName;
contact.DisplayName = string.Format("{0} {1}", firstName, lastName);
contact.EmailAddresses[EmailAddressKey.EmailAddress1] = email;
contact.EmailAddresses[EmailAddressKey.EmailAddress1].Address = email;
contact.EmailAddresses[EmailAddressKey.EmailAddress1].Name = string.Format("{0} {1}", firstName, lastName);
contact.PhoneNumbers[PhoneNumberKey.PrimaryPhone] = phoneNumber;
contact.CompanyName = companyName;
contact.NickName = string.Format("{0} {1}", firstName, lastName);

contact.Save();

However, the new contact is not showing in the autocomplete list when creating a new email message for the 'to' field. If I manually create a new contact in Outlook autocomplete picks up the new contact and they'll display in the list. Is there a way to use EWS to add this new contact to that autocomplete list? I am using Outlook 2010

但是,在为“收件人”字段创建新电子邮件时,新联系人未显示在自动填充列表中。如果我在Outlook中手动创建新联系人,则自动完成功能会选择新联系人,并且它们将显示在列表中。有没有办法使用EWS将这个新联系人添加到该自动完成列表?我正在使用Outlook 2010

1 个解决方案

#1


No, EWS doesn't update the nickname cache. There's more information on this here: https://msdn.microsoft.com/en-us/library/office/ff625288.aspx.

不,EWS不会更新昵称缓存。这里有更多相关信息:https://msdn.microsoft.com/en-us/library/office/ff625288.aspx。

#1


No, EWS doesn't update the nickname cache. There's more information on this here: https://msdn.microsoft.com/en-us/library/office/ff625288.aspx.

不,EWS不会更新昵称缓存。这里有更多相关信息:https://msdn.microsoft.com/en-us/library/office/ff625288.aspx。