ContactItem.Email1Address抛出错误。 [英] ContactItem.Email1Address throwing an error.

查看:104
本文介绍了ContactItem.Email1Address抛出错误。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

概述:我正在构建一个Outlook加载项,用于更新共享交换联系人列表中的联系人信息。

Overview: I am building an Outlook add-in that updates contact information from a shared exchange contact list.

问题:我正在尝试从Outlook中的默认联系人列表中读取电子邮件地址。

Problem: I am trying to read an email address from my default contact list in Outlook.

我可以成功将对象信息拉入ContactItem对象,我可以查看除了与电子邮件地址有关的任何内容之外的所有内容信息。例如:

I can successfully pull Object Information into a ContactItem object and I can view everything within EXCEPT anything pertaining to email address info. So for example:

ContactItem.Fullname //成功

ContactItem.Fullname //Success

ContactItem.Email1Address //错误

ContactItem.Email1Address //Error

I在尝试通过excel访问VBA中的相同信息时,在C#中获取COMException并出现运行时错误。

I get a COMException in C# and a runtime error when trying to Access the same info in VBA through excel.

但是,如果我将宏直接写入Outlook,我可以访问该信息,但是这样并不理想,因为宏观分布不是很有趣。 

I can however, access the info if I write a macro directly into Outlook, but this isn't ideal, as macro distribution isn't very fun. 

我感觉这是一个触发错误的安全问题。有谁知道我能做些什么来缓解这个问题。我在家尝试相同的代码并且有效,但就像我说我需要它在工作中。

I have a feeling this is a security issue triggering the error. Does anybody know what i can do to relieve this issue. I try the same code at home and it works, but like I said I need it at work.

-Justin




推荐答案

确切的例外情况是什么?

What is the exact exception?

所有联系人都会发生这种情况吗?或只是一些?

Does it happen for all contacts or just some?

如果您选择联系人,您是否可以在 OutlookSpy 中看到该属性,单击OutlookSpy功能区上的项目按钮并选择Email1Address属性?

Can you see that property in OutlookSpy if you select the contact, click the Item button on the OutlookSpy ribbon and select the Email1Address property?


这篇关于ContactItem.Email1Address抛出错误。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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