none
Delete Entries from Autocomplete Cache Outlook 2013 Programmatically RRS feed

  • Question

  • Hi,

    I am able to access bytes in cache using below code.

    Microsoft.Office.Interop.Outlook.Application oApp = Globals.ThisAddIn.Application;
    Microsoft.Office.Interop.Outlook.MAPIFolder inboxFolder = oApp.GetNamespace("MAPI").GetDefaultFolder(OlDefaultFolders.olFolderInbox);

    StorageItem storage = inboxFolder.GetStorage("IPM.Configuration.Autocomplete", OlStorageIdentifierType.olIdentifyByMessageClass);

    PropertyAccessor propertyAcc = storage.PropertyAccessor;

    byte[] got = propertyAcc.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x7C090102");

    I am converting bytes array to List of Bytes and creating the List of contacts.

    Now i have got start position and end position of particular entry.

    Please let me know how i can delete that entry.

    lstGot.RemoveRange(cnt.StartPos, cnt.EndPos - cnt.StartPos + 1);

    Where lstGot is

    List<byte> lstGot = got.OfType<byte>().ToList();

    Next time i loop through entries , it give me error.

    Please suggest any other way to delete entries from cache programmatically in Outlook 2013 . I need to delete certain entries based on condition like All entries with domain "@gmail.com".

    Also updation does not seems to work.

    propertyAcc.SetProperty("http://schemas.microsoft.com/mapi/proptag/0x7C090102", lstGot.ToArray());

    Do i need to call something after that code?.

    Thanks

    Jaspreet Singh

    Monday, January 20, 2014 12:36 PM

All replies