K
Kerry
I have created a user form which shows me a list of the
contacts I have in my Outlook account. Upon choosing a
contact the details are passed to variables which are
then used to address letters, labels etc.
The list of contacts are not showing in alphabetical
order, can anyone please advsie on how to sort this list?
Please find my code below, many thanks for your time:-
recipient:
x = 0
Set oApp = CreateObject("Outlook.Application")
Set oNspc = oApp.GetNamespace("MAPI")
For Each oItm In _
oNspc.GetDefaultFolder(olFolderContacts).Items
If oItm.Class = olContact Then 'no DL used
With Me.RecipList
.AddItem (oItm.FullName)
.Column(1, x) = oItm.JobTitle
.Column(2, x) = oItm.CompanyName
.Column(3, x) = oItm.BusinessAddress
.Column(4, x) = oItm.BusinessTelephoneNumber
.Column(5, x) = oItm.BusinessFaxNumber
End With
x = x + 1
End If
Next oItm
contacts I have in my Outlook account. Upon choosing a
contact the details are passed to variables which are
then used to address letters, labels etc.
The list of contacts are not showing in alphabetical
order, can anyone please advsie on how to sort this list?
Please find my code below, many thanks for your time:-
recipient:
x = 0
Set oApp = CreateObject("Outlook.Application")
Set oNspc = oApp.GetNamespace("MAPI")
For Each oItm In _
oNspc.GetDefaultFolder(olFolderContacts).Items
If oItm.Class = olContact Then 'no DL used
With Me.RecipList
.AddItem (oItm.FullName)
.Column(1, x) = oItm.JobTitle
.Column(2, x) = oItm.CompanyName
.Column(3, x) = oItm.BusinessAddress
.Column(4, x) = oItm.BusinessTelephoneNumber
.Column(5, x) = oItm.BusinessFaxNumber
End With
x = x + 1
End If
Next oItm