EWS: Only able to retrieve some user defined fields


Hi

I can't figure out why I only partly can load userdefined fields trough E

WS.Below the important part of the code in question.

Only userdefined fileds "Liga" and "AntalDeltid" are loaded into the extendedproperties in foundcontact....not he other two.

I have checked with Outlook where I can access the missing fields and all of them contains a value.

Anybody having an idea where to look for a solution?

- Allan

Dim USER_Liga As New ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "Liga", MapiPropertyType.String)
Dim USER_Fuldtids As New ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "AntalFuldtids", MapiPropertyType.Integer)
Dim USER_Deltid As New ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "AntalDeltid", MapiPropertyType.Integer)
Dim USER_Amatrer As New ExtendedPropertyDefinition(DefaultExtendedPropertySet.PublicStrings, "AntalAmatrer", MapiPropertyType.Integer)
     

Dim view As New ItemView(pageSize, offset, OffsetBasePoint.Beginning)
view.OrderBy.Add(ContactSchema.DisplayName, SortDirection.Ascending)

view.PropertySet = New PropertySet(BasePropertySet.FirstClassProperties)
view.PropertySet.Add(USER_Liga)
view.PropertySet.Add(USER_Fuldtids)
view.PropertySet.Add(USER_Amatrer)
view.PropertySet.Add(USER_Deltid)

Dim foundItems As FindItemsResults(Of Item) = service.FindItems(correctfolder.Id, searchFilter, view)

For Each kontakt In foundItems
	If TypeOf kontakt Is Contact Then
		Dim foundContact As Contact = kontakt
		foundContact.Load(view.PropertySet)
			.
			.
			.





August 6th, 2015 10:38am

I'd suggest you enable tracing https://msdn.microsoft.com/en-us/library/office/dd633676(v=exchg.80).aspx on your requests and also check the properties using a MAPI editor like OutlookSpy or MFCMapi if you using the wrong MapiPropertyType then a property won't be returned. The other thing I would suggest is try setting the property using EWS on a test item and then try to retrieve those properties.

Cheers
Glen

Free Windows Admin Tool Kit Click here and download it now
August 6th, 2015 10:46pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics