Free Support Forum - aspose.com

Issue while reading OLM File


#22

there is an another issue with that , there is an folder in olm file named as “Calendar”. but doesn’t shows it.


#23

@praw,

I have written a recursive method to iterate through all folders and sub-folders and it reads all folders.

public static void TestOLM()
{
    String dataDir="C:\\Email\\Outlook2\\";
    OlmStorage storage = new OlmStorage(dataDir + "Outlook2.olm");
    try
    {
        for (OlmFolder folder : storage.getFolderHierarchy())
        {
            ReadFolders(folder, storage);
        }
    }
    catch(Exception s)
    {
        s.printStackTrace();
    }
}

public static void ReadFolders(OlmFolder folder, OlmStorage storage)
{
    if (folder.getSubFolders().size() > 0)
    {
        for (OlmFolder sub_folder : folder.getSubFolders())
        {
            ReadFolders(sub_folder, storage);
        }
    }
    else
    {
        System.out.println("Subfolder: " + folder.getName());
        if (folder.hasMessages())
        {
            // extract messages from folder
            for (MapiMessage msg : storage.enumerateMessages(folder))
            {
                System.out.println("Subject: " + msg.getSubject());
            }
        }
    }
}

#24

can you suggest me how do i create full path of each folder by reading olm file recursively


#25

@praw,

Can you please explain the details about full path you are inquiring.


#26

There is an issue with an olm file while reading.
It throws an exception :class com.aspose.email.system.exceptions.FormatException: One of the identified items was in an invalid format.
Outlook for Mac Archive.zip (2.8 MB)


#27

@pradeepnegi,

I have worked with the OLM file shared by you and have been able to observe the issue specified. An issue with ID EMAILJAVA-34511 has been created in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.


#28

There are several issues while reading olm file, There are several exceptions generating like: values cannot be null, One of the identified items was in an invalid format.,.etc. please let me know when it will be fixed.


#29

@pradeepnegi,

We will share good news with you as soon as the issues will be fixed for associated tickets and shared source files.


#30

Hi, i have tried to read olm file with your latest dll 19.2.0.0 [C#] but still facing the same issue

“An item with the same key has already been added.”

Please let me know how to resolve this issue? Please update me soon.


#31

@indianseomarketer

We will share good news with you as soon as the associated tickets will be resolved.