Adding a contact link in the Links Collection 
Author Message
 Adding a contact link in the Links Collection

I'm stuck on this issue:
How does one add a link to the Links collection?

I've attempted the following
        ....
        Set objOL = New Outlook.Application
        Set myNameSpace = objOL.GetNamespace("MAPI")
        Set fdrtasks = myNameSpace.GetDefaultFolder(olFolderTasks)
        Set BSMDBitems = fdrtasks.Items

        ' set up outlook objects for contact
        Dim BSMDBContacts As Outlook.ContactItem
        Dim BSMDBContactItems As Outlook.Items
        Dim fdrContacts As Outlook.MAPIFolder
        Dim fdrBSMDBContacts As Outlook.MAPIFolder
        Dim itmCurrentContact As Outlook.ContactItem

        Set fdrContacts = myNameSpace.GetDefaultFolder(olFolderContacts)
        Set fdrBSMDBContacts = fdrContacts.Folders("BSM Database Contacts")
        Set BSMDBContactItems = fdrBSMDBContacts.Items
        ...
        strfind = "... something to search"
        Set itmCurrentContact = BSMDBContactItems.Find(strfind)
                If TypeName(itmCurrentTask) = "Nothing" Then
                    Set itmNewTask = fdrtasks.Items.Add(olTaskItem)

                    With itmNewTask
                            .Links.Add (itmCurrentContact)
<< - this is where it fails.
In Access VBA , the watch window  shows the value of itmCurrentContact to be
the contact name, since .NAME is the default item value.
All the code works, except when attempting to add the .Links collection.

Am I referencing to the contact record item incorrectly?

Preston



Tue, 29 Mar 2005 03:55:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Code to add a shortcut link to a contact journal

2. Code to add a shortcut link to a contact journal

3. How do I programmatically link contact to contact?

4. Linking tasks and contacts

5. Getting the linked contacts of an appointment

6. Generate a link in the Contacts field?

7. Linking Recipients to Contact Item???

8. Document Contact Linking .... PLEASE HELP

9. Contact and journal item link

10. Contact Links: Sendmail and Save Appointment Events

11. Public Contact linked to a public journal entry

12. From a new mail message, how do I link a selected contact

 

 
Powered by phpBB® Forum Software