SmartTag Custom actions

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

SmartTag Custom actions
How to user SmartTag ActionNeeded event 
Jacco van der Pol




Posts: 30
Joined: 2005-09-13
Hi,

I'm trying to build a custom recognizer. It recognizes words alright. What I now want to do is for each recognized word see what actions can be taken. I want to have 1 - 3 different menu options, but this depends on the word which is tagged.

I think I need to use ActionNeeded event. But how should I use it (when does it fire). And when it fires, how do I obtain the tagged word.

Jacco
Posted 08 Dec, 2005 14:39:37 Top
Sergey Grischenko


Add-in Express team


Posts: 7205
Joined: 2004-07-05
Hi Jacco.

As for the ActionNeeded event, it fires after the Recognize event has occured. The 'sender' parameter is the ADXSmartTag component. In the ActionNeeded event handler you can manipulate your actions via the methods of the Actions collection.
However there is another way to implement your idea. You can download an example using the link below:
http://www.add-in-express.com/projects/dynamicsmarttags.zip
Posted 09 Dec, 2005 13:18:33 Top
Jacco van der Pol




Posts: 30
Joined: 2005-09-13
Hi Sergey, unfortunately this does not help me. The Actionneeded event fires only once, but I need it for every recognized word, because each word has different actions. I could solve it by using a lot of different lists and a lot of different smart tags, each of one with it's own action. But I dont really like that, because I want to deterimine the diff smarttags dynamically.

So, I have a long list with all different kinds of words in it. For every word I need different actions. Example, I type:

John is our manager and he is responsible for the development department.

John needs the actions: send an email, enter his birthday
Manager needs the actions: See all the managers of the comp
Development Department needs the actions: Send email to all empl of dept

etc.

I think I need to trap the event where the uses clicks the smarttag button and just before the menu (with actions) is show. And yes, I need to know which word is selected.

Lot's of reading, but I hope I was clear enough (my english is not to good).

Jacco
Posted 11 Dec, 2005 13:19:39 Top
Sergey Grischenko


Add-in Express team


Posts: 7205
Joined: 2004-07-05
Hi Jacco.

Actually I don't use the ActionNeeded event in my example at all.
Did you run my example?
Posted 12 Dec, 2005 07:08:49 Top
Jacco van der Pol




Posts: 30
Joined: 2005-09-13
I did, but it does not solve my problem. I'd like to have 1 smarttag and every time the user presses the smarttag button, I want to fill the menu items (actions) just before the users sees them.
Posted 12 Dec, 2005 10:19:06 Top
Sergey Grischenko


Add-in Express team


Posts: 7205
Joined: 2004-07-05
Ok. I will try to change the example.
Posted 12 Dec, 2005 10:32:36 Top
Sergey Grischenko


Add-in Express team


Posts: 7205
Joined: 2004-07-05
Hi Jacco.

I have been trying to find a solution for you using one smart tag only but with no luck. I think you will have to use several smart tags with the corresponding number of actions.
Posted 13 Dec, 2005 11:59:54 Top
Jacco van der Pol




Posts: 30
Joined: 2005-09-13
Ok, I will try that.
Thanks for looking into it.

Posted 13 Dec, 2005 12:34:28 Top