Links Collection Problem 
Author Message
 Links Collection Problem

When an appointment is created in a user's local Calendar
folder I am creating an identical public folder calendar
entry (not for all appointments, just some, according to a
logical field value set by the user).

However there is a problem copying over the Contacts
attached to the appointment (i.e. the item.links).

It isn't possible to say "publicItem.links = item.links"
so I have got around it by doing:

for i = 1 to item.links.count
   vTempStr = "[Full Name] = """ & item.links(i) & """"
   Set mySearchItems = myPublicContactsFolder.Items
   Set myContact = mySearchItems.Find(vTempStr)
   myItem.Links.Add myContact
next

This works fine until you get 2 people with the same name
because the mySearchItems.Find(vTempStr) just goes to the
first contact it finds with that name (if you do "msgbox
item.links(i)" you see the persons name).

You end up with a link in the public record to the
wrong "John Smith" or whoever!

I would really appreciate some assistance with this.  
Please email me if I need to clarify the above.

Thanks
Rob.



Wed, 16 Feb 2005 00:54:02 GMT  
 Links Collection Problem
Once you get the Link, use Link.Item.EntryID to get the EntryID of the
contact that is the link. Then use GetItemFromID to get that contact
item. It's actually pretty easy.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Lead Author, Professional Outlook 2000 Programming, Wrox Press
Lead Author, Beginning VB 6 Application Development, Wrox Press
Attachment Options
http://www.slovaktech.com/attachmentoptions.htm
Extended Reminders
http://www.slovaktech.com/extendedreminders.htm


Quote:
> When an appointment is created in a user's local Calendar
> folder I am creating an identical public folder calendar
> entry (not for all appointments, just some, according to a
> logical field value set by the user).

> However there is a problem copying over the Contacts
> attached to the appointment (i.e. the item.links).

> It isn't possible to say "publicItem.links = item.links"
> so I have got around it by doing:

> for i = 1 to item.links.count
>    vTempStr = "[Full Name] = """ & item.links(i) & """"
>    Set mySearchItems = myPublicContactsFolder.Items
>    Set myContact = mySearchItems.Find(vTempStr)
>    myItem.Links.Add myContact
> next

> This works fine until you get 2 people with the same name
> because the mySearchItems.Find(vTempStr) just goes to the
> first contact it finds with that name (if you do "msgbox
> item.links(i)" you see the persons name).

> You end up with a link in the public record to the
> wrong "John Smith" or whoever!

> I would really appreciate some assistance with this.
> Please email me if I need to clarify the above.

> Thanks
> Rob.



Wed, 16 Feb 2005 02:20:53 GMT  
 Links Collection Problem
Or just use Link.Item?

--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
     Microsoft Outlook Programming Jumpstart - coming September 2002
     http://www.slipstick.com/books/jumpstart.htm



Quote:
> Once you get the Link, use Link.Item.EntryID to get the EntryID of the
> contact that is the link. Then use GetItemFromID to get that contact
> item. It's actually pretty easy.

> --
> Ken Slovak
> [MVP - Outlook]
> http://www.slovaktech.com
> Lead Author, Professional Outlook 2000 Programming, Wrox Press
> Lead Author, Beginning VB 6 Application Development, Wrox Press
> Attachment Options
> http://www.slovaktech.com/attachmentoptions.htm
> Extended Reminders
> http://www.slovaktech.com/extendedreminders.htm



> > When an appointment is created in a user's local Calendar
> > folder I am creating an identical public folder calendar
> > entry (not for all appointments, just some, according to a
> > logical field value set by the user).

> > However there is a problem copying over the Contacts
> > attached to the appointment (i.e. the item.links).

> > It isn't possible to say "publicItem.links = item.links"
> > so I have got around it by doing:

> > for i = 1 to item.links.count
> >    vTempStr = "[Full Name] = """ & item.links(i) & """"
> >    Set mySearchItems = myPublicContactsFolder.Items
> >    Set myContact = mySearchItems.Find(vTempStr)
> >    myItem.Links.Add myContact
> > next

> > This works fine until you get 2 people with the same name
> > because the mySearchItems.Find(vTempStr) just goes to the
> > first contact it finds with that name (if you do "msgbox
> > item.links(i)" you see the persons name).

> > You end up with a link in the public record to the
> > wrong "John Smith" or whoever!

> > I would really appreciate some assistance with this.
> > Please email me if I need to clarify the above.

> > Thanks
> > Rob.



Wed, 16 Feb 2005 02:25:16 GMT  
 Links Collection Problem
Thanks for your post, Ken.

Don't know if I am missing the point, but Outlook doesn't
seem to recognise Link.Item.EntryID (get error
message "Object required: 'link'").

Regards,
Rob.

Quote:
>-----Original Message-----
>Once you get the Link, use Link.Item.EntryID to get the
EntryID of the
>contact that is the link. Then use GetItemFromID to get
that contact
>item. It's actually pretty easy.

>--
>Ken Slovak
>[MVP - Outlook]
>http://www.slovaktech.com
>Lead Author, Professional Outlook 2000 Programming, Wrox
Press
>Lead Author, Beginning VB 6 Application Development, Wrox
Press
>Attachment Options
>http://www.slovaktech.com/attachmentoptions.htm
>Extended Reminders
>http://www.slovaktech.com/extendedreminders.htm



>> When an appointment is created in a user's local
Calendar
>> folder I am creating an identical public folder calendar
>> entry (not for all appointments, just some, according
to a
>> logical field value set by the user).

>> However there is a problem copying over the Contacts
>> attached to the appointment (i.e. the item.links).

>> It isn't possible to say "publicItem.links = item.links"
>> so I have got around it by doing:

>> for i = 1 to item.links.count
>>    vTempStr = "[Full Name] = """ & item.links(i) & """"
>>    Set mySearchItems = myPublicContactsFolder.Items
>>    Set myContact = mySearchItems.Find(vTempStr)
>>    myItem.Links.Add myContact
>> next

>> This works fine until you get 2 people with the same
name
>> because the mySearchItems.Find(vTempStr) just goes to
the
>> first contact it finds with that name (if you do "msgbox
>> item.links(i)" you see the persons name).

>> You end up with a link in the public record to the
>> wrong "John Smith" or whoever!

>> I would really appreciate some assistance with this.
>> Please email me if I need to clarify the above.

>> Thanks
>> Rob.

>.



Fri, 18 Feb 2005 17:30:25 GMT  
 Links Collection Problem
Try
    Item.Links(i).Item.EntryID

Does that work?
--

Regards,
Simon Jones
MillStream Designs Ltd
Independent IT Consultants


Quote:
> Thanks for your post, Ken.

> Don't know if I am missing the point, but Outlook doesn't
> seem to recognise Link.Item.EntryID (get error
> message "Object required: 'link'").

> Regards,
> Rob.

> >-----Original Message-----
> >Once you get the Link, use Link.Item.EntryID to get the
> EntryID of the
> >contact that is the link. Then use GetItemFromID to get
> that contact
> >item. It's actually pretty easy.

> >--
> >Ken Slovak
> >[MVP - Outlook]
> >http://www.slovaktech.com
> >Lead Author, Professional Outlook 2000 Programming, Wrox
> Press
> >Lead Author, Beginning VB 6 Application Development, Wrox
> Press
> >Attachment Options
> >http://www.slovaktech.com/attachmentoptions.htm
> >Extended Reminders
> >http://www.slovaktech.com/extendedreminders.htm



> >> When an appointment is created in a user's local
> Calendar
> >> folder I am creating an identical public folder calendar
> >> entry (not for all appointments, just some, according
> to a
> >> logical field value set by the user).

> >> However there is a problem copying over the Contacts
> >> attached to the appointment (i.e. the item.links).

> >> It isn't possible to say "publicItem.links = item.links"
> >> so I have got around it by doing:

> >> for i = 1 to item.links.count
> >>    vTempStr = "[Full Name] = """ & item.links(i) & """"
> >>    Set mySearchItems = myPublicContactsFolder.Items
> >>    Set myContact = mySearchItems.Find(vTempStr)
> >>    myItem.Links.Add myContact
> >> next

> >> This works fine until you get 2 people with the same
> name
> >> because the mySearchItems.Find(vTempStr) just goes to
> the
> >> first contact it finds with that name (if you do "msgbox
> >> item.links(i)" you see the persons name).

> >> You end up with a link in the public record to the
> >> wrong "John Smith" or whoever!

> >> I would really appreciate some assistance with this.
> >> Please email me if I need to clarify the above.

> >> Thanks
> >> Rob.

> >.



Fri, 18 Feb 2005 18:24:06 GMT  
 Links Collection Problem
Item.Links.Item(1).item.entryid seems to do the trick.

Thanks All :-))

Rob.

Quote:
>-----Original Message-----
>Try
>    Item.Links(i).Item.EntryID

>Does that work?
>--

>Regards,
>Simon Jones
>MillStream Designs Ltd
>Independent IT Consultants



>> Thanks for your post, Ken.

>> Don't know if I am missing the point, but Outlook
doesn't
>> seem to recognise Link.Item.EntryID (get error
>> message "Object required: 'link'").

>> Regards,
>> Rob.

>> >-----Original Message-----
>> >Once you get the Link, use Link.Item.EntryID to get the
>> EntryID of the
>> >contact that is the link. Then use GetItemFromID to get
>> that contact
>> >item. It's actually pretty easy.

>> >--
>> >Ken Slovak
>> >[MVP - Outlook]
>> >http://www.slovaktech.com
>> >Lead Author, Professional Outlook 2000 Programming,
Wrox
>> Press
>> >Lead Author, Beginning VB 6 Application Development,
Wrox
>> Press
>> >Attachment Options
>> >http://www.slovaktech.com/attachmentoptions.htm
>> >Extended Reminders
>> >http://www.slovaktech.com/extendedreminders.htm



>> >> When an appointment is created in a user's local
>> Calendar
>> >> folder I am creating an identical public folder
calendar
>> >> entry (not for all appointments, just some, according
>> to a
>> >> logical field value set by the user).

>> >> However there is a problem copying over the Contacts
>> >> attached to the appointment (i.e. the item.links).

>> >> It isn't possible to say "publicItem.links =
item.links"
>> >> so I have got around it by doing:

>> >> for i = 1 to item.links.count
>> >>    vTempStr = "[Full Name] = """ & item.links(i)
& """"
>> >>    Set mySearchItems = myPublicContactsFolder.Items
>> >>    Set myContact = mySearchItems.Find(vTempStr)
>> >>    myItem.Links.Add myContact
>> >> next

>> >> This works fine until you get 2 people with the same
>> name
>> >> because the mySearchItems.Find(vTempStr) just goes to
>> the
>> >> first contact it finds with that name (if you
do "msgbox
>> >> item.links(i)" you see the persons name).

>> >> You end up with a link in the public record to the
>> >> wrong "John Smith" or whoever!

>> >> I would really appreciate some assistance with this.
>> >> Please email me if I need to clarify the above.

>> >> Thanks
>> >> Rob.

>> >.

>.



Fri, 18 Feb 2005 18:36:11 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. hyper links collection problem?

2. Adding a contact link in the Links Collection

3. How to use Links Collection

4. Linked list or collections of objects?

5. New mirrors / Collection of 2700+ links about Object-Orientation

6. Collection of 2500+ links about Object-Orientation - interested ?

7. Collection of 2000+ links about Object-Orientation - interested ?

8. Interested in a collection of OO links ?

9. Links collection using CDO

10. collection of Visual Basic links

11. Collections, Collections and More Collections

12. Altering the order of the links in the links collection.

 

 
Powered by phpBB® Forum Software