Overriding WordApp.OnDocumentOpen Event

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

Overriding WordApp.OnDocumentOpen Event
Incompatible Types: Parametr Lists Differ 
Nickg


Guest


Hi,

Having trouble with this, I declared the replacement procedure as

procedure TAddInModule.DoOnDocOpen(Sender: TObject; var Doc: OLEVariant);

which is what the Word2000.pas file seems to say it should be, but it don't work.

I want to override the open and save events for all Office apps, and I realise I'll need separate procedures for each app to deal with different event names and parameters, but where can I find the parameter info to do it successfully?
TIA Nick.
Posted 19 Jan, 2005 04:15:57 Top
Dmitry Kostochko


Add-in Express team


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

What Delphi version do you use?

I want to override the open and save events for all Office apps, and I realise I'll need separate procedures for each app to deal with different event names and parameters, but where can I find the parameter info to do it successfully?

You can find parameter info in the appropriate source files. See the {$DELPHI}\Ocx\Servers folder.
Posted 19 Jan, 2005 05:50:06 Top
Guest


Guest


Hi,
I'm using Delphi 7 Pro with the update patch

Nick
Posted 19 Jan, 2005 14:36:53 Top
Guest


Guest


Sorry, I missed the botom bit. I found the source files, that's where I got the info about the parameters to use (in Word2000.pas).

TWordApplicationDocumentOpen = procedure(Sender: TObject; var Doc: OleVariant) of object;

I checked the Excel2000.pas code aganst one of your HowTos (Closing an Excel workbook)and the parameters matched so I assumed the Word2000.pas code would to, but it won't compile.

Nick
Posted 19 Jan, 2005 14:43:19 Top
Dmitry Kostochko


Add-in Express team


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

Strange. In my Word2000.pas from Delphi 7 I found the following declaration:

TWordApplicationDocumentOpen = procedure(ASender: TObject; const Doc: WordDocument) of object;


Posted 20 Jan, 2005 07:03:40 Top
Guest


Guest


Hi Dmitry,

My fault, I was looking at Delphi6\ocx\servers\Word2000.pas not Delphi7. I ran a search to find the file but must have clicked on the wrong copy, sorry for that. Thanks for clearing it up for me, I obviously need better glasses.

Regards Nick
Posted 20 Jan, 2005 15:05:26 Top