Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Outlook 2007 Links.Item - what is returned? (http://www.outlookbanter.com/outlook-vba/30865-outlook-2007-links-item-what.html)

David Hyde October 24th 06 11:17 AM

Outlook 2007 Links.Item - what is returned?
 
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?

Sue Mosher [MVP-Outlook] October 24th 06 01:26 PM

Outlook 2007 Links.Item - what is returned?
 
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
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"David Hyde" wrote in message ...
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?



All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com