Load XML or DOCX Word Document from Stream & Get All Text Content using C# .NET

When trying to open a particular file using the below code the code hangs on the constructor until the thread is killed after two hours. Clearly there is an issue with the way the contents of the file are being handled but it would be great fi ti could either successfully open the file or thrown an exception. Happy to share the file but can’t see an option to do so.

using (var memoryStream = new MemoryStream(sourceBytes))
{
      var doc = new Document(memoryStream);
      fileContents = doc.GetText();
}

@ChrisOUK,

Have you tried the latest (20.6) version of Aspose.Words for .NET on your end? In case the problem still remains, please ZIP and upload your input Word document you are getting this problem with here for testing. We will then investigate the issue on our end and provide you more information.

Alternatively, you may upload the ZIP file to Dropbox and share the download link here for testing.

Hi Sorry I should have confirmed yes this is with 20.6. Here’s a link to the file. https://1drv.ms/u/s!AvnRVSneADjPjJMH0TqGEUv2_r_zbQ?e=SHpXaF

Many thanks!

@ChrisOUK,

We have logged this problem in our issue tracking system with ID WORDSNET-20703. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.

The issues you have found earlier (filed as WORDSNET-20703) have been fixed in this Aspose.Words for .NET 20.8 update and this Aspose.Words for Java 20.8 update.