Quantcast
Channel: Exchange Server Development forum
Viewing all articles
Browse latest Browse all 7132

Exchange Web Services Managed API Contact Photo

$
0
0

I am working with the Exchange Web Services Managed API and am having an issue with getting a contacts photo.  I am using FindItemsResult object to retrieve a collection of items with the following code:

        Dim contactsFolder As ContactsFolder = contactsFolder.Bind(EWS.EWService, parentFolder.FolderId, New PropertySet(BasePropertySet.IdOnly, FolderSchema.TotalCount))
        Dim numItems As Integer = contactsFolder.TotalCount

        'Get all existing contacts in folder
        Dim view As ItemView = New ItemView(numItems)
        view.PropertySet = New PropertySet(BasePropertySet.FirstClassProperties, ContactSchema.Photo)
        Dim contacts As FindItemsResults(Of Item) = EWS.EWService.FindItems(parentFolder.FolderId, view)
        For Each i As Item In contacts
            If TypeOf i Is Contact Then

                Dim p As Byte() = DirectCast(i, Contact).DirectoryPhoto

            End If
        Next

The contact item always returns nothing for the DirectoryPhoto property even though the contact in exchange has a photo and the contact "HasPicture" property is true.

Any ideas or examples of reading a contacts photo would be appreciated.


Viewing all articles
Browse latest Browse all 7132

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>