Cool.... its working, cheers RobDog, my code now looks like this:
VB Code:
Sub Create_Address_Book() Dim oApp As Outlook.Application Dim oNS As Outlook.Namespace Dim oCF As Outlook.MAPIFolder Dim iOne As Integer Set oApp = New Outlook.Application Set oNS = oApp.GetNamespace("MAPI") Dim oContact As Outlook.ContactItem Set oCF = oNS.Folders(1).Folders("Contacts") iOne = 2 Application.Cursor = xlWait Do While Not Range("A" & iOne) = "" Set oContact = oCF.Items.Find("[FullName] = " & Range("b" & iOne) & " " & Range("a" & iOne) & "") If TypeName(oContact) = "Nothing" Then Set oContact = oApp.CreateItem(olContactItem) oContact.CompanyName = "President Kennedy School" oContact.Email1Address = Range("D" & iOne).Text oContact.Email1AddressType = "Business" oContact.Email1DisplayName = Range("B" & iOne).Text & " " & Range("A" & iOne).Text oContact.FileAs = Range("A" & iOne).Text & ", " & Range("B" & iOne).Text oContact.FirstName = Range("B" & iOne).Text oContact.FullName = Range("B" & iOne).Text & " " & Range("A" & iOne).Text oContact.LastName = Range("A" & iOne).Text oContact.Save Else Application.Cursor = xlDefault MsgBox "The contact '" & oContact & "' already exists" Application.Cursor = xlWait End If iOne = iOne + 1 Loop Application.Cursor = xlDefault End Sub
How do i change the Contacts view programaitically?




Reply With Quote