PeterRHawkes
10-18-2011, 09:34 AM
The following code runs through each contact in the default folder. Problem is that when it comes across a Contact Group the 'Next olContact' statement creates a Type Mismatch with olContact = Nothing.
How can I prevent this error? Is it possible to filter out the Contact Groups? :banghead:
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set olFolder = objName.GetDefaultFolder(olFolderContacts)
Set olContact = olFolder.Items.GetFirst
For Each olContact In olFolder.Items
With olContact
' various actions on contact take place here
End With
Next olContact
Thank you.
Peter R Hawkes
How can I prevent this error? Is it possible to filter out the Contact Groups? :banghead:
Set olApp = Outlook.Application
Set objName = olApp.GetNamespace("MAPI")
Set olFolder = objName.GetDefaultFolder(olFolderContacts)
Set olContact = olFolder.Items.GetFirst
For Each olContact In olFolder.Items
With olContact
' various actions on contact take place here
End With
Next olContact
Thank you.
Peter R Hawkes