Smart Tag to take action immediately when recognised

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

Smart Tag to take action immediately when recognised
 
Roger Middlebrook


Guest


Is it possible for a Smart Tag to take an action immediately it is recognised? The user has to Undo if they didn't actually want the action to happen.

Oops, sorry, I've posted this in the .NET forum when I use VCL but I think the answer will be applicable to .NET too.
Posted 03 Feb, 2006 08:17:05 Top
Dmitry Kostochko


Add-in Express team


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

I am afraid I do not quite understand your goal. Does your smart tag action change the content of the document?

Posted 03 Feb, 2006 13:44:05 Top
Roger Middlebrook


Guest


Yes, I want to change the document.

What I want is to replace the smart tag as soon as it is recognised.

Currently what I want to do is replace a post code with a bar code as soon as the post code is recognised. I don't want the user to have to select an action before the bar code is inserted.

If the user does not like the change, I would like them to use Undo to get rid of it.

Thanks

Roger
Posted 05 Feb, 2006 10:47:17 Top
Dmitry Kostochko


Add-in Express team


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

I am afraid your idea can not be realized using Smart Tags only. You may try to change the document as soon as the smart tag is recognized, but I think you will need some COM add-in that will perform the "undo" operation.

Posted 06 Feb, 2006 07:36:59 Top
Roger Middlebrook


Guest


That sounds OK, thanks.

Forget the Undo bit for the moment - how do I get the tag to replace itself immediately it is recognised? The main problem appears to be that I don't know where the tag is in the document, so I don't know where the replacement text goes.
Posted 06 Feb, 2006 10:36:10 Top
Dmitry Kostochko


Add-in Express team


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

You are right, the OnRecognize event handler is not intended for direct iteraction with a document. So, you can try to search for the text you got in the event handler throughout the document.

May I suggest another approach? I think it would be much easier to create the add-in that will do all work with button click or with some object model event (e.g. the OnDocumentOpen, OnDocumentChange).

Posted 06 Feb, 2006 10:51:19 Top
Roger Middlebrook


Guest


Unfortunately my customer really wants a smart tag.

I will be supplying an add-in too and that will put the replacement text where the user's cursor is. This will be button and menu driven.

Thanks anyway.

Roger
Posted 07 Feb, 2006 02:53:41 Top