Mark Graham
Posts: 6
Joined: 2006-08-11
|
Can anyone let me know if it would be possible to disable or make invisible the "Stop Recognizing "term" as > "recognizer"/smart tag" popup on a smart tag's actions button?
If it's not possible, I still need to figure out what event fires when that happens, so I can reverse the ill effects, because it would cause a bug in my add-in if a user stopped recognizing a term without giving my add-in code a chance to fully unregistering the smart tag.
I plan to work my way around this somehow, but I figured I'd ask to see if there is already a known workaround to this before I explore it any further. I wasn't able to find anything in the ADX forums or documentation.
Thanks,
Mark |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Mark.
The fact is that smart tags continue to work after the user has stopped them via the smart tag menu. In this case Word just doesn't display the actions.
... it would cause a bug in my add-in if a user stopped recognizing a term without giving my add-in code a chance to fully unregistering the smart tag
What bug do you mean? Could you please provide more detailed information on how the add-in should work? |
|
Mark Graham
Posts: 6
Joined: 2006-08-11
|
Hi Sergey,
Thanks for your reply. The fact that it stops recognizing without unregistering the smart tag is actually the problem. It just lists it in the ignore.xml file in the exceptions folder and then ignores it.
My add-in creates new user-defined recognizers at run-time and stores statistical information on them in a database for the user to look at later. To keep my database clean, I need to know when a user wants to stop recognizing one of the recognizers they created, so that I can delete it from the database and unregister and delete the dll for it as well. With the built in "stop recognizing" action, my add-in does not get told that the user wanted to stop recognizing it, and so it is still listed in the database as active, and that screws up the report when the user wants to see the statistical data.
If there were and event fired when this happens, i could attach the removal code there, but I haven't seen that event. The only thing I can think of is putting a file watcher on ignore.xml and if it changes, find which one it just listed inside the file and then run my deletion code on that one, but it seems kind of hackish and unstable to do it that way.
I don't know, this isn't really a problem with add-in express, so I don't want to bother you too much with it, just thought maybe I was overlooking something simple. You don't need to work on this though, I'll figure out the best way around it.
thanks,
Mark |
|
Mark Graham
Posts: 6
Joined: 2006-08-11
|
The fact is that smart tags continue to work after the user has stopped them via the smart tag menu. In this case Word just doesn't display the actions.
Ah, I just now realized what you are saying, it's still recognizing the word, just not showing that it is. That's still very annoying that it does that, because it doesn't make much sense to the user if they try to stop recognizing it and it still gets recognized. hmmm... i'm gonna have to think about this. |
|
Sergey Grischenko
Add-in Express team
Posts: 7235
Joined: 2004-07-05
|
Hi Mark.
I think that the Smart Tags Object Model is not so flexible to implement your idea. I agree with you that the file watcher is not a good solution but I don't see another way right now. |
|