Application in Smart Tag

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

Application in Smart Tag
What's the best way to get a ref to the application in a Smart Tag 
Roger Middlebrook


Guest


What is the best way to get a reference to the host application within smart tag code?
Posted 24 Feb, 2006 08:42:55 Top
Dmitry Kostochko


Add-in Express team


Posts: 2875
Joined: 2004-04-05
Hello Roger,

You can get a reference to a part of the document recognized by the smart tag. See the Target parameter in the TadxSmartTagAction.OnClick event handler.


procedure TSmartTagModule.adxSmartTag1Actions0Click(Sender: TObject;
  const AppName: WideString; const Target: IDispatch; const Text,
  Xml: WideString; LocaleID: Integer);
begin
  ShowMessage(AppName + #13#10 +
    OleVariant(Target).Application.Name);
end;


Posted 25 Feb, 2006 07:26:38 Top
Roger Middlebrook


Guest


Sorry Dmitry, I want to be able to get a reference to the application in the OnRecognize event or even in the OnInitialize in the SmartTagModule.

Any chance?
Posted 27 Feb, 2006 04:30:14 Top
Dmitry Kostochko


Add-in Express team


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

You may try to use the GetActiveOleObject function depending on the ApplicationName parameter of the event handlers you mentioned.

Posted 27 Feb, 2006 06:59:36 Top
Cedric Dellevian




Posts: 10
Joined: 2006-08-31
Hi Dmitry,

I would like to use smarttag to modify a word document.

But, I don't have access to the word application, how to do this ?

Your sample displayed the application name, but I can't reach anything else. Could you show me how to insert text for example ?

Regards,

Cedric
Posted 31 Aug, 2006 13:08:03 Top
Dmitry Kostochko


Add-in Express team


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

Please contact me directly by email, I will try to create an example for you.

Posted 04 Sep, 2006 05:43:00 Top