none
How to read the Mileage property with ews (Exchange Web Services) BPOS RRS feed

  • Question

  • Hi, im trying to retrieve the mileage property from a mail item.  
    This code does NOT work, Has anyone done this?

    Private Function MileageProperty() As ExtendedPropertyDefinition
            Dim propertySetId As New Guid("ec08aa45-5fff-4a07-93ae-8fcaecc7db41")
            Return New ExtendedPropertyDefinition(propertySetId, 34100, MapiPropertyType.String)
    End Function

    Dim service = New ExchangeService(ExchangeVersion.Exchange2007_SP1)
    service.Url = New Uri(My.Settings.Url)
    service.Credentials = New WebCredentials(My.Settings.LogonName, My.Settings.Password)

    Dim view = New ItemView(Integer.MaxValue)
    view.PropertySet = New PropertySet(BasePropertySet.IdOnly, New PropertyDefinitionBase() {ItemSchema.Subject, MileageProperty()})
    view.PropertySet.Add(MileageProperty)
    view.Traversal = FolderTraversal.Shallow

    Dim findfolderresults = service.FindItems(WellKnownFolderName.Inbox, view)

    Tuesday, February 1, 2011 8:11 AM

Answers

  • Not sure where you got your GUID from but its not valid for that property you should be using PSETID_Common eg try something like

    ExtendedPropertyDefinition Mileage = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Common, 34100, MapiPropertyType.String);
    
    Cheers
    Glen
    • Marked as answer by TERRAS Pascal Wednesday, February 2, 2011 8:14 AM
    Wednesday, February 2, 2011 2:19 AM

All replies

  • Not sure where you got your GUID from but its not valid for that property you should be using PSETID_Common eg try something like

    ExtendedPropertyDefinition Mileage = new ExtendedPropertyDefinition(DefaultExtendedPropertySet.Common, 34100, MapiPropertyType.String);
    
    Cheers
    Glen
    • Marked as answer by TERRAS Pascal Wednesday, February 2, 2011 8:14 AM
    Wednesday, February 2, 2011 2:19 AM
  • Thx, this seems to work.

    don't know why is used the guid, found it somewhere in my struggle :-) 
    found the list of propertys:  http://msdn.microsoft.com/en-us/library/cc815517.aspx

    Cheers Pascal

    Wednesday, February 2, 2011 8:33 AM