Add Contacts from Access 2k to outlook 2k
No attachments for this post
This code will send customer information such as Name address , city, state, zip to outlook2 contacts
Original Author: John Pope
You will need to set the references to use the Outlook 9.0 Object library.
Private Sub cmdAddOutlook_Click()
'I have used this code in two ways. I have made this one here just work in the cmdbutton that I created on the Access form and placed all the code in here
'You can also make this a function
Dim oOutlook As Outlook.Application
Dim oContact As Outlook.ContactItem
Set oOutlook = New Outlook.Application
'Create and new Contact
Set oContact = oOutlook.CreateItem(olContactItem)
'Change what you need in here. All Vairables after the = sign are fields in my database.
'You will need to change them to fields that you have in yours.
'To find a list of the items here you can set go to the object browser.
.FullName = LastName & "," & FirstName
.BusinessAddress = Address
.BusinessAddressCity = City
.BusinessAddressState = State
.BusinessAddressPostalCode = Zip
.HomeTelephoneNumber = HomePhone
.BusinessTelephoneNumber = BusPhone
.MobileTelephoneNumber = CellPhone
.Email1Address = Email
.CompanyName = CompanyName
.Categories = CompanyName
'Change msgbox ot what you want it to say. I just left it simple
MsgBox "Contact has been Added", vbInformation
Set oOutlook = Nothing
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.