D
Dan
I have a list of contacts in my own database that I am accessing with a VB
program that I have written. I want to loop through this list and export them
to my Outlook 2007 contacts folder.
I am starting with the following code to access my Outlook folder:
Dim Contact As Outlook.ContactItem
Dim ContactList As Object
Dim ContactsFolder As Object
Dim OutlookApp As Object
Dim OutlookNamespace As Object
Set OutlookApp = GetObject(, "Outlook.Application")
Set OutlookNamespace = OutlookApp.GetNamespace("MAPI")
Set ContactsFolder = OutlookNamespace.GetDefaultFolder(olFolderContacts)
Set ContactList = ContactsFolder.Items
I need to find whether a contact is already in the ContactList based on the
CompanyName field. If it exists, I want to update certain fields in the
ContactItem. If it doesn't, I want to define a new ContactItem.
I have used collections very little, and so I'm not sure how to efficiently
find an item in the collection and know whether or not it exists. Thanks for
your help!
program that I have written. I want to loop through this list and export them
to my Outlook 2007 contacts folder.
I am starting with the following code to access my Outlook folder:
Dim Contact As Outlook.ContactItem
Dim ContactList As Object
Dim ContactsFolder As Object
Dim OutlookApp As Object
Dim OutlookNamespace As Object
Set OutlookApp = GetObject(, "Outlook.Application")
Set OutlookNamespace = OutlookApp.GetNamespace("MAPI")
Set ContactsFolder = OutlookNamespace.GetDefaultFolder(olFolderContacts)
Set ContactList = ContactsFolder.Items
I need to find whether a contact is already in the ContactList based on the
CompanyName field. If it exists, I want to update certain fields in the
ContactItem. If it doesn't, I want to define a new ContactItem.
I have used collections very little, and so I'm not sure how to efficiently
find an item in the collection and know whether or not it exists. Thanks for
your help!