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?