I created a PST file using the ASPOSE EMail API and then add MSG files using the same API but when I try to open the file in Outlook, I get an errorERROR:Cannot expand the folder. Windows Search exitied without properly closing your Outlook data file. I've attached a screen shot of the error.Here is some of the code I'm using.
Aspose.Email.Outlook.Pst.PersonalStorage pst = Aspose.Email.Outlook.Pst.PersonalStorage.FromFile(@"c:\temp\temp.pst" );
Aspose.Email.Outlook.Pst.FolderInfo fi = pst.RootFolder;
foreach (var folder in folders)
{
FolderInfo lookup= fi.GetSubFolder(folder);
if (lookup == null)
{
fi = fi.AddSubFolder(folder);
}
else
{
fi = lookup;
}
fi.AddMessage(Aspose.Email.Outlook.MapiMessage.FromFile(exportItem.ExportFilePath)); Aspose.Email.Outlook.Pst.PersonalStorage pst = Aspose.Email.Outlook.Pst.PersonalStorage.FromFile(@"c:\temp\temp.pst" );
Aspose.Email.Outlook.Pst.FolderInfo fi = pst.RootFolder;
foreach (var folder in folders)
{
FolderInfo lookup= fi.GetSubFolder(folder);
if (lookup == null)
{
fi = fi.AddSubFolder(folder);
}
else
{
fi = lookup;
}
fi.AddMessage(Aspose.Email.Outlook.MapiMessage.FromFile(exportItem.ExportFilePath));