Free Support Forum - aspose.com

Issue while reading OLM File


#1

Hi I am using the following code with your latest dll (18.2)

But getting this error:- An item with the same key has already been added.
try
{
OlmStorage storage = new OlmStorage(Program.OLMFileName);

            foreach (OlmFolder folder in storage.FolderHierarchy)
            {
                if (folder.HasMessages)
                {
                    // extract messages from folder
                    foreach (MapiMessage msg in storage.EnumerateMessages(folder))
                    {
                        MessageBox.Show(msg.Subject);
                    }
                }

                // read sub-folders
                if (folder.SubFolders.Count > 0)
                {
                    foreach (OlmFolder sub_folder in folder.SubFolders)
                    {
                        MessageBox.Show("Subfolder: " + sub_folder.Name);
                    }
                }

            }
        }
        catch (Exception ex)
        {
            MessageBox.Show(ex.Message);
        }

#2

@ajaykumar2018

Thank you for contacting Aspose support.

It is requested to kindly share sample OLM file with us, so that we could investigate this issue in detail. You may share confidential files in a private message. For this purpose, please click on my name and find “Message” button.


#3

How to read Olm file from aspose.Email in java
" OlmStorage storage = new OlmStorage(dataDir + “OutlookforMac.olm”); "
This Class is not present in the aspose 18.9.4.


#4

@pradeepnegi

Thank you for writing back to us.

The support for Outlook for Mac Data File (.OLM) using Aspose.Email is added in version 18.10 so the previous versions does not support OLM file.


#5

Thank you for reply


#6

This method throws and exception while reading olm file from this method.
OlmStorage storage = null;
try
{
storage = new OlmStorage(fin);
}
catch(Exception ep)
{
System.out.println(ep.getMessage());
}

exception : " An element with the same key already exists in the dictionary"


#7

@pradeepnegi

We were able to reproduce this issue and it has been logged with ID “EMAILJAVA-34478” for further investigation. You will automatically be informed here once we have more information to share.