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("");

    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 "".

    Also updation does not seems to work.

    propertyAcc.SetProperty("", lstGot.ToArray());

    Do i need to call something after that code?.


    Jaspreet Singh

    Monday, January 20, 2014 12:36 PM

All replies