Outlook 2007 Links.Item - what is returned?

D

David Hyde

In Outlook 2003 I my code included accessing data in a contact item by
passing a an item from the Links collection. The code was ,object =
<object>.Links.Item(1).Item. That worked fine for months.
On upgrading to 2007 B2TR I had to remove the .Item bit at the end. The
code ran OK. Suddenly accessing the object returned (which should be an
olContact results in an eroor - the object does not support that method or
property. The debuffer declares the object to be of class "Link".
Why has the Links.Item(index) stopped returning an object of class olContact?
 
S

Sue Mosher [MVP-Outlook]

Links.Item(index) will return a Link object. Link.Item will return either a ContactItem or Nothing. Your code needs to be able to handle both possible outcomes.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top