ANSI format support


#1

Hi,

When i try to delete messages from PST which is ANSI format (Outlook 97-2002), it fails to delete and throws exception “The ANSI file version editing is not implemented.”

I was using Aspose.Email for .Net ver 17.7.0.0, but also tried latest version 19.2 and see same error when using FolderInfo.DeleteChildItems() method.

Can Aspose handle deleting messages from ANSI format PST file?

Thanks,
Hiren


#2

@hirenp,

I have observed the issue shared by you and request you to please share the source PST with us around with used sample code. I will be able to verify the issue further on my end on provision of requested information.


#3

Mudassir,

I’ve attached ANSI format PST file i created for testing.

ansi-tmp.zip (2.8 MB)

My sample code i use to delete emails from PST is as follow:

 private void ReducePSTSample()
{
    string path = @"D:\Temp\unicodepst\ansi-tmp.pst";
    var pstFile = PersonalStorage.FromFile(path);
    var rootFolder = pstFile.RootFolder;
    EnumerateFolder(rootFolder);
    pstFile?.Dispose();
}

private void EnumerateFolder(FolderInfo folderInfo)
{
    var beforeDelete = folderInfo.EnumerateMessagesEntryId().ToList();
    if (beforeDelete.Count > 0)
    {
        //delete messages
        folderInfo.DeleteChildItems(beforeDelete);
    }

    if (folderInfo.HasSubFolders)
    {
        foreach (var folder in folderInfo.GetSubFolders(FolderKind.Normal))
        {
            EnumerateFolder(folder);
        }
    }
}

When DeleteChildItems() function is called, it throws an exception with message “The ANSI file version editing is not implemented.”.

Thanks,
Hiren Patel


#4

@hirenp,

I have worked with the sample code shared by you using Aspose.Email for .NET 19.3. There have been no exception on my end while working with sample code. Can you please try using suggested version.


#5

Mudassir,

I’ve tried using 19.3 version of dll (copied from net4.0 folder in downloaded zip file), and i still get same exception.

Hiren


#6

@hirenp,

I have tested using Aspose.Email for .NET 19.3 and there is no issue while using .NET 4.0 assembly as well. For your kind reference, can you please check following image. Can you please verify the same in a new test application on your end.


#7

Mudassir,

I looked at the image you posted. I noticed your code was setting a license in Main(). I had forgotten to do that in my test application, so i tried it but license i have doesn’t allow me to use new version 19.3.

Failed to set license. Details: The subscription included in this license allows free upgrades until 03 Sep 2018, but this version of the product was released on 28 Mar 2019. Please renew the subscription or use a previous version of the product.

When i use my current version of dll (17.7.0.0.), i still get error "The ANSI file version editing is not implemented.” If i try new dll without setting license, i still get error “The ANSI file version editing is not implemented.” I have downloaded trial version of 19.2 and 19.3 to test, but no luck. Is there a license file for trial version i need from Aspose?

Thanks,
Hiren


#8

I even tried getting temporary license and use latest 19.3 version of dll. But i still get error about “The ANSI file version editing is not implemented.”.


#9

@hirenp,

I have tried accessing the PST using provided sample code in Windows 7 x64 with VS 2015 and Aspose.Email for .NET 19.3 (.NET 4.0 assembly). There is no issue incurring on my end and I have already share the snapshot with you. Can you please share the sample VS project along with environment details where you are able to reproduce the issue.


#10

I’m testing this on my windows 7 Professional x64 SP1, VS 2015 Professional SP3. I’ve attached full solution for my test project i’m using. To test it, when you run, browse and select an ANSI formatted pst (one i had uploaded earlier or any other), and then click on “Reduce PST” button.

SampleAppForAspose.zip (5.3 MB)


#11

@hirenp,

Thank you for sharing the details. I have been able to reproduce the issue with shared sample project. An issue with ID EMAILNET-39438 has been created in our issue tracking system to 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.