I have my 'standard' Contacts folder in Outlook 2002 and I wish to check if a subfolder "Special Contacts" has been created. If it hasn't then I wish to create it, if it has then I wish to download the data.
I am having problems in checking/creating the new subfolder. Please can anyone help?
I use the code below to get data from my 'standard' folder.
I am having problems in checking/creating the new subfolder. Please can anyone help?
I use the code below to get data from my 'standard' folder.
Code:
Sub GetOutlookDetails()
Dim objContactsFolder As Outlook.MAPIFolder
Dim objContacts As Outlook.Items
Dim objContact As Object
Dim iCount As Integer
Set objContactsFolder = Session.GetDefaultFolder(olFolderContacts)
Set objContacts = objContactsFolder.Items
iCount = 0
For Each objContact In objContacts
If TypeName(objContact) = "ContactItem" Then
.Cells(iCount + 2, 1) = objContact.Categories
.Cells(iCount + 2, 2) = objContact.Title
.Cells(iCount + 2, 3) = objContact.FirstName
.Cells(iCount + 2, 4) = objContact.LastName
etc