none
ExchangeService EWS get notes RRS feed

  • Question

  • Hi all

    Does anybody knows how to get all the Notes from the Exchange Server ?
    If yes, I would be happy for a Little sample.

    Thanks and best regards
    Frank Uray
    Thursday, March 7, 2013 3:58 PM

All replies

  • You just use a FindItems Query on the Notes folder eg

                ItemView ivItemview = new ItemView(1000);
                SearchFilter sfSearchFilter = new SearchFilter.IsEqualTo(ItemSchema.ItemClass, "IPM.StickyNote");
                FindItemsResults<Item> fiFitems = null;
                do {
                    fiFitems = service.FindItems(WellKnownFolderName.Notes, sfSearchFilter, ivItemview);
                    foreach (Item itItem in fiFitems.Items) {
                        Console.WriteLine(itItem.Subject + " - " + itItem.ItemClass);
                    }
                    ivItemview.Offset += fiFitems.Items.Count;
                }
                while (fiFitems.MoreAvailable);


    Cheers
    Glen
    Friday, March 8, 2013 8:51 AM
  • Hi Glen

    Thanks a lot for your code, it works fine ! :-)

    Would it be possible to ask you some more questions ?
    Right now, I try to create a new Item (Note) ...
    Microsoft.Exchange.WebServices.Data.Item _Item = new Microsoft.Exchange.WebServices.Data.Item();
    This does not work, what is the right way to do it ?

    Thank you and best regards
    Frank Uray

    Tuesday, March 12, 2013 1:37 PM
  • There are no strongly Typed objects for StickyNotes so you need to use the EmailMessage Class change the ItemClass and then set the extended properties for the Note eg

          EmailMessage message = new EmailMessage(service);
          message.ItemClass = "IPM.StickyNote";
          Guid guid = new Guid("0006200E-0000-0000-C000-000000000046");
          message.SetExtendedProperty(new ExtendedPropertyDefinition(guid, 0x8B00, MapiPropertyType.Integer), 1);
          // colour
          message.SetExtendedProperty(new ExtendedPropertyDefinition(guid, 0x8B02, MapiPropertyType.Integer), 200);
          // width
          message.SetExtendedProperty(new ExtendedPropertyDefinition(guid, 0x8B03, MapiPropertyType.Integer), 166);
          // height
          message.SetExtendedProperty(new ExtendedPropertyDefinition(guid, 0x8B04, MapiPropertyType.Integer), 200);
          // left
          message.SetExtendedProperty(new ExtendedPropertyDefinition(guid, 0x8B05, MapiPropertyType.Integer), 200);
          // top
          message.Subject = "Test Note" ;
          message.Body = new MessageBody("Test of conversion from Email to note"); 
          message.Save(WellKnownFolderName.Notes);
    
    Cheers
    Glen
    Wednesday, March 13, 2013 5:02 AM