none
ContactItem.Email1Address throwing an error. RRS feed

  • Question

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

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

    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 //Success

    ContactItem.Email1Address //Error

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

    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


    Wednesday, May 28, 2014 5:38 PM

All replies

  • What is the exact exception?

    Does it happen for all contacts or just some?

    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?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, May 28, 2014 5:41 PM
  • Hello Justin,

    Did you check the Warn me about suspicious activity when my anitvirus software is inactive or out-of-date (recommended) which is specified in the Programmatic Access option in the Microsoft Outlook Trust Center?

    Is your anti-virus software on the computer out-of-date? What error code do you get in the exception object?

    Most probably you get a standard security prompt via a COM exception. You can read more about this in the Outlook "Object Model Guard" Security Issues for Developers article.

    Wednesday, May 28, 2014 5:51 PM