Function call issues

Add-in Express™ Support Service
That's what is more important than anything else

Function call issues
 
Kristjan H




Posts: 27
Joined: 2005-10-29
Hi again

I created word addin, this contains procedure SaveToFile(name,path:string).

Also i have button on addin for opening Form2 containing datafields, uses MyAddinWord. I cant call directly this function savetofile, i must create everything etc. And i can use the function savetofile but wordapp gives me different errors. i put some code examples also. I believe that i made some mistakes in declaring....

1.
procedure TAddInModule2.savetofile(const FailName, kataloog: string);
var
sPath, format: OleVariant;
begin


// winword:
sPath := 'c:\blabla.doc';
format := 0;
showmessage('tere kallis');
! Error is next

addinmodule2.WordApp.Connect;
addinmodule2.WordApp.ActiveDocument.SaveAs(sPath,format,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam,EmptyParam);
exit;


2.
procedure TForm2.BitBtn1Click(Sender: TObject);
var
lll:taddinmodule2;
begin
lll:=taddinmodule2.Create(nil);
lll.savetofile('testt.doc','c:\');
end;

Thank you very much for help!

kristjan
Posted 01 Nov, 2005 16:30:48 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hi Kristjan,


Could you please send me your code. I'll make necessary changes and send it back to you.

Posted 02 Nov, 2005 07:23:59 Top