We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Words used in Delphi leads to invalid floating point operation

I have a same Problems like described in this thread: Aspose.Words invoked through COM fails to open some Word templates

Unfortunately the solutions of this thread don’t help in my case.

Here is the code I’m using:

procedure TForm7.Button1Click(Sender: TObject);
var
WordApp, ADoc: OLEvariant;
begin
CoInitialize(nil);
WordApp := CreateOleObject(‘Aspose.Words.ComHelper’);
ADoc := CreateOleObject(‘Aspose.Words.Document’);
try
ADoc := WordApp.Open(‘s:/doc/doc1.docx’);
ADoc.Save(‘s:\doc\doc2.docx’);
finally
CoUninitialize;
end;
end;

And here is the error message I get:
In Project S:… occured an error with the following message: ‘Floating Point invalid Operation at 0x79aa47a8’. Process stopped…

Does anyone has the same issue or a solution for this Problem?

Hi Andreas,

Can you please share which version of Delphi are you using?

Best Regards,

We tried it with Delphi 2010, XE5 and XE7.

All with the same error.

Hi Andreas,

Thanks for the information. We will test your code on Delphi and let you know.

Best Regards,

Hi Andreas,

Sorry, I was not able to see the issue at my end using the samples I have. Can you please share your sample document to reproduce the issue? This looks like a document specific issue.

Best Regards,

Thanks for testing.



We just used a Word document without any Content. I will add it as attachment.



Here is also the whole Project in Delphi. Maybe it helps:



unit Unit7;



interface



uses

Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,

Dialogs, StdCtrls, Unit26, ComObj, ActiveX;



type

TForm7 = class(TForm)

Button1: TButton;

procedure Button1Click(Sender: TObject);

private

{ Private-Deklarationen }

public

{ Public-Deklarationen }

end;



var

Form7: TForm7;



implementation







{$R *.dfm}



procedure TForm7.Button1Click(Sender: TObject);

var

WordApp, ADoc: OLEvariant;

begin

CoInitialize(nil);

WordApp := CreateOleObject(‘Aspose.Words.ComHelper’);

ADoc := CreateOleObject(‘Aspose.Words.Document’);

try

ADoc := WordApp.Open(‘s:/doc/doc1.docx’);

ADoc.Save(‘s:\doc\doc2.docx’);

finally

CoUninitialize;

end;

end;



end.

Hi Andreas,

Thanks for the details. I was able to see the same issue at my end. We are further investigating this issue and will let you know once we have any update. Sorry for the inconvenience.

Best Regards,

Thanks for testing! We are really interested in the results because we want to buy your product.

There are two questions left:

Does Aspose.Words also support pdf/a?
And can I use Aspose.Words within a service?

Hi Andreas,

Yes, Aspose.Words supports PDF/A and it can also be used within a service however further investigation is required for your original issue i.e Document.Save method is throwing exception on saving your documents.

We will keep you updated on this.

Best Regards,

Hi Andreas,

Can you please also contact Delphi team in the meantime as in Delphi some documents do not work however same documents work in other programming languages when used via COM?

Best Regards,