LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Outlook and Excel Integration for Contacts

Hi,

I found this code from one of your responses, but as a
rank beginner - first attempt at this kind of thing, that
I don't know enought as to where to go from here.

I have a UserForm with 1 ComboBox (ComboBox1) and 1
Command Button (CommandButton1). I need to somehow, and
maybe this is not the best way to do it, get the user when
they click the combo box to have it display their Contacts
folder (will eventually be a Public Folder) to see the
names of the companies. They would pick a name and it
would insert the address, phone contact name et al fields
into the worksheet at specific cells. I know this code it
not the right code but it appears to set a link up in some
way.

So any help where to begin would be truly appreciated!!!!!

Private Sub UserForm_Initialize()

'Sets ComboBox RowSource to Outlook Contacts Company Field
'ComboBox ControlSource is D3
'ComboBox1.RowSource = "Names"

End Sub

Private Sub CommandButton1_Click()
Sub GetContact()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olCi As ContactItem

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Personal Folders").Folders
("Contacts")

For Each olCi In Fldr.Items
If olCi.NickName = "DoubleD" Then
Debug.Print olCi.FullName,
olCi.Email1Address
End If
Next olCi

Set olCi = Nothing
Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

'Next coding needs to be insert into cells D3 =
Company, D4 = Street Address, D5 = Locality, D6 =
State_or_Province D7 = Postal_Code, D8 = Display_Name, D9
= Office_Telephone_Number, D10 = Business_Fax_Number & B3
Department_Name

'Hides UserForm1
UserForm1.Hide
End Sub

Thanks again SO MUCH!!! If I can just get this I can
finish my project!

Shauna
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Contacts from Excel to Outlook Ergg Excel Discussion (Misc queries) 1 January 20th 10 10:12 PM
How do I export contacts from Excel back to Outlook Contacts? corvettego Excel Discussion (Misc queries) 2 August 17th 09 06:29 PM
export from 07 excel to outlook contacts Bluedee Excel Worksheet Functions 0 September 18th 08 04:36 PM
Outlook and Excel Integration Shauna Koppang Excel Programming 1 August 21st 03 04:33 PM
Excel & Outlook Integration - Urgent! Bill Li Excel Programming 0 August 19th 03 04:10 AM


All times are GMT +1. The time now is 04:10 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"