Aspose.Words .Net via COM in Delphi7. Document.Save hungs when saving as ODT

I am trying to use Aspose.Words .Net in Delphi 7 via COM Interop.
I download Aspose.Word for .Net 19.8.0 for evaluation.
My code:

var AComHelper, ADoc: OleVariant;
begin
CoInitialize(nil);
AComHelper := CreateOleObject(‘Aspose.Words.ComHelper’);
ADoc := CreateOleObject(‘Aspose.Words.Document’);
try
ADoc := AComHelper.Open(‘D:\D1.odt’);
ADoc.Save(‘D:\D1-copy.odt’);
finally
CoUninitialize;
end;
end;

if D1.odt is empty document then Aspose creates D1-copy.odt.
but if D1.odt is not empty, Aspose does nothing.
the same behavior if i converting docx to odt/doc/pdf.
Aspose works correctly only when i open D1.docx and save it as D1-copy.docx

The similar code on C# from VisualStudio 2010 works correctly.

Document doc = new Document(“D:/D1.odt”);
doc.Save(“D:/D1-copy.odt”);

Could you help to comment?

@petrovalexandr

Could you please attach your input document here for testing? We will investigate the issue on our side and provide you more information.

here is my simple ODT document containing only one line 'Hello World!D1.zip (6.3 KB)

@petrovalexandr

We have not found any issue with your ODT file. We suggest you please get the temporary license and apply it before importing the document. Hope this helps you.

I would like to clarify with you.

  1. Is it true that the evaluation version of Aspose.Words provides full product functionality as written here besides some limitations (watermark, size limitations).
  2. Can a problem arise because I use Delphi 7 and not other late versions of Delphi?

First, I would like to make sure that I can work with Aspose.Words .Net via COM in Delphi7, and only then buy a license.

@petrovalexandr

After applying license, no limitation is applied e.g. watermark, documentation truncation.

Are you facing this issue only with re-saving ODT file? Please try to convert your ODT to DOCX or some other formats and share your findings.

Please also share your working environment e.g. operating system, .NET Framework etc. We will investigate this issue and provide you more information on it.

My working environment details are Windows 7, .Net Farmework 4.8.
I’ve searched through Free Support Forum and found an issue that helps to resolve of mine
https://forum.aspose.com/t/aspose-words-invoked-through-com-fails-to-open-some-word-templates/50912/8
I think the matter is in old Delphi version. And using Set8087CW function helps to ignor Floating Point Exception, so I could save and convert our documents.

My code as following.

var
  AComHelper, ADoc: OleVariant;
  l8087CW: Word;
begin
  l8087CW := Default8087CW;
  Set8087CW($133f);
  try
    AComHelper := CreateOleObject(‘Aspose.Words.ComHelper’);
    ADoc := CreateOleObject(‘Aspose.Words.Document’);
    ADoc := AComHelper.Open(‘D:\D1.doc’);
    ADoc.Save(‘D:\D1-copy.odt’);
  finally
    Set8087CW(l8087CW);
  end; 
end;

@petrovalexandr

It is nice to hear from you that you have found the solution of your issue. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.