I am not sure how you are determining for what contact you want to insert
the information, but if you were using a userform, you could have a combobox
on that form that you loaded with the contacts and the required fields and
then used the ,boundcolumn property of the combobox to get the fields that
you want for the contact selected in the combobox
Private Sub UserForm_Initialize()
Dim oApp As Outlook.Application
Dim oNspc As NameSpace
Dim oItm As ContactItem
Dim x As Integer
If Not DisplayStatusBar Then
DisplayStatusBar = True
End If
StatusBar = "Please Wait..."
x = 0
Set oApp = CreateObject("Outlook.Application")
Set oNspc = oApp.GetNamespace("MAPI")
For Each oItm In oNspc.GetDefaultFolder _
(olFolderContacts).Items
With Me.cboContactList
.AddItem (oItm.FullName)
.Column(1, x) = oItm.BusinessAddress
.Column(2, x) = oItm.BusinessAddressCity
.Column(3, x) = oItm.BusinessAddressState
.Column(4, x) = oItm.BusinessAddressPostalCode
End With
x = x + 1
MsgBox x
Next oItm
StatusBar = ""
Set oItm = Nothing
Set oNspc = Nothing
Set oApp = Nothing
Dim MyArray() As Variant, i As Integer, j As Integer, m As Integer, n As
Integer, target As Document, newtable As Table, myitem As Range
'Load client data into MyArray
MyArray = cboContactList.List()
' Create a new document containing a table
Application.ScreenUpdating = False
'Sort the data
Set target = Documents.Add
Set newtable = target.Tables.Add(Range:=target.Range(0, 0),
numrows:=cboContactList.ListCount, NumColumns:=5)
' Populate the cells of the table with the contents of the array
For i = 1 To cboContactList.ListCount
For j = 1 To 5
newtable.Cell(i, j).Range.InsertBefore MyArray(i - 1, j - 1)
Next j
Next i
' sort the table
newtable.Sort ExcludeHeader:=False ', FieldNumber:="Column 1",
SortFieldType:=wdSortFieldText, SortOrder:=wdSortOrderAscending
i = newtable.Rows.Count
' Get the number of columns in the table of client details
j = 5
' Set the number of columns in the Listbox to match
' the number of columns in the table of client details
cboContactList.ColumnCount = 5
' Define an array to be loaded with the client data
Dim NewArray() As Variant
'Load client data into MyArray
ReDim NewArray(i, j)
For n = 0 To j - 1
For m = 0 To i - 1
Set myitem = newtable.Cell(m + 1, n + 1).Range
myitem.End = myitem.End - 1
NewArray(m, n) = myitem.Text
Next m
Next n
' Load data into combobox
cboContactList.List() = NewArray
target.Close wdDoNotSaveChanges
Application.ScreenUpdating = True
End Sub
In the application in which I was using this, I was then displaying the
information for the selected contact in controls on the userform by means of
the following code:
Private Sub cboContactList_Change()
txtAddress1 = cboContactList.Column(0)
txtAddress2 = cboContactList.Column(1)
txtAddress3 = cboContactList.Column(2)
txtAddress4 = cboContactList.Column(3)
txtAddress5 = cboContactList.Column(4)
End Sub

Signature
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
> Graham: Bummmer, I was afraid of that! Thank you very much for your
> help!!
[quoted text clipped - 37 lines]
>> > suggestions?
>> > Thanks for any help!
Graham Mayor - 12 Mar 2008 08:24 GMT
The method under discussion calls the AddressBook dialog which is limited in
the fields that it can access; this method isn't and so it should be
possible to adapt it to produce the required results. Thanks for reminding
me of it :)

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> I am not sure how you are determining for what contact you want to
> insert the information, but if you were using a userform, you could
[quoted text clipped - 135 lines]
>>>> suggestions?
>>>> Thanks for any help!
Mathew - 12 Mar 2008 15:11 GMT
Doug, Graham: I actually used Graham advice and got the project to work.
But, I'm going to spend some time re-thinking it using Doug's approach.
Thank you both!
> I am not sure how you are determining for what contact you want to insert
> the information, but if you were using a userform, you could have a combobox
[quoted text clipped - 126 lines]
> >> > suggestions?
> >> > Thanks for any help!
Graham Mayor - 13 Mar 2008 07:44 GMT
I have been playing with Doug's suggested method - see also
http://msdn2.microsoft.com/en-us/library/aa260784.aspx and while it does
offer far greater flexibility, the communication with Outlook is much slower
than with the more limited Addressbook function. I guess you have to trade
convenience for practicality if you want more than Addressbook can provide.

Signature
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Doug, Graham: I actually used Graham advice and got the project to
> work. But, I'm going to spend some time re-thinking it using Doug's
[quoted text clipped - 149 lines]
>>>>> Any suggestions?
>>>>> Thanks for any help!