Witzker
Senior Member
- OS Version(s)
- iOS
- Outlook version
- Outlook 2019 32-bit
- Email Account
- Exchange Server 2007
How can the result of e.g this search be displayes in a new window in a list with name and Email?
I cannot find the way to schow the result in a list where I can then click the contact to open it
Hope for Suggestions
THX
Code:
Sub CopyContacts()
Dim ContactsFolder As Outlook.Folder
Dim DestFolder As Outlook.Folder
Dim ContactItems As Outlook.Items
Dim ResItems As Outlook.Items
Dim sFilter, strCategory As String
Dim iNumRestricted As Integer
Dim Item As ContactItem, CopiedItem As ContactItem
' Use the default folder
Set ContactsFolder = Session.GetDefaultFolder(olFolderContacts)
' Use the selected folder
'Set ContactsFolder = Application.ActiveExplorer.CurrentFolder
' copy to subfolder
Set DestFolder = ContactsFolder.Folders("Copies")
' Get all of the items in the folder
Set ContactItems = ContactsFolder.Items
'create the Restrict filter
strCategory = InputBox("Enter the category")
sFilter = "[Categories] = " & strCategory
' Apply the filter to the collection
Set ResItems = ContactItems.Restrict(sFilter)
iNumRestricted = 0
'Loop through the items in the collection.
For Each Item In ResItems
iNumRestricted = iNumRestricted + 1
I cannot find the way to schow the result in a list where I can then click the contact to open it
Hope for Suggestions
THX