Access.2007.VBA.Bibl..

(John Hannent) #1
strWebSite = Nz(.WebPage)
strNotes = Nz(.Body)
.Close (olSave)
End With

With rst
rst.AddNew
![CompanyName] = strCompanyName
![FirstName] = strFirstName
![LastName] = strLastName
![Salutation] = strSalutation
![EmailName] = strEMail
![JobTitle] = strJobTitle
![WorkPhone] = strBusinessPhone
![MobilePhone] = strMobilePhone
![FaxNumber] = strFaxNumber
![Notes] = strNotes
![WorkAddress] = strWorkAddress
![WorkCity] = strWorkCity
![WorkStateOrProvince] = strWorkStateProv
![WorkPostalCode] = strWorkPostalCode
![WorkCountry] = strWorkCountry
![HomeAddress] = strHomeAddress
![HomeCity] = strHomeCity
![HomeStateOrProvince] = strHomeStateProv
![HomePostalCode] = strHomePostalCode
![HomeCountry] = strHomeCountry
![WorkPhone] = strHomePhone
![WebSite] = strWebSite
.Update
End With
lngContactCount = lngContactCount + 1
End If
Next itm

rst.Close

If lngContactCount = 0 Then
MsgBox “No contacts to import from Outlook”
Else
MsgBox lngContactCount _
& “ contact(s) imported from Outlook”
End If
ErrorHandlerExit:
Exit Function


If Err.Number = 429 Then
Set appOutlook = CreateObject(“Outlook.Application”)
Resume Next

Working with Outlook Items 8

Free download pdf