Click here to Skip to main content
15,891,764 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
MS Word 2013 adds a nifty new "insert control" to add rows or columns to a table (see http://blogs.office.com/b/microsoft-word/archive/2012/08/30/working-with-tables-in-the-new-word.aspx[^] and http://blogs.office.com/b/microsoft-word/archive/2012/07/30/introducing-word-2013.aspx[^]). I have a Word 2010 add-in that I want to adapt to 2013. To work as I need it to, the add-in needs to either suppress the appearance of that control (i.e., don't let the user see it) or intercept its activation (i.e., get notified that the user clicked on it) and respond to it (like--for those who remember TI's "Touch and Tell"--play the "You found it!" music). I have not been able to find anything on these controls other than their brief mention in the above referenced articles. Can someone provide some guidance, please?

For Maciej Los: I am not trying to do anything in the document or to the document. I need to interact with the UI to either (1) prevent that new control from showing so the user cannot click on it, or (2) know that the user clicked on that control ("user added a row/column <here>") so I can do other things in response to that row/column insertion. If the user clicks on that Insert control and my add-in can't know about it, the project is over.
Posted
Updated 23-Jul-13 6:16am
v4

After conferring with MS, we learned that there are no hooks provided to suppress this button nor to be notified of its execution. However, its use does trigger a SelectionChanged event and we can compare the row/column count at that time with the last count we knew. If they differ in the right direction, the button was clicked. It seems hokey, but it works.
 
Share this answer
 
I'm not sure i understand you well, but...
Have a look here: How to: Programmatically Add Rows and Columns to Word Tables[^]


[EDIT #1]
I think i understand your question now (revision 3). I'll try to explain you using VBA code.
Let say, you want to add text into MS Word document which should interact with user on double-click.

In MS Word 2003 (and higher) we can use Insert->Fields... menu to add "interacting" fields to the document. Quite often MACROBUTTON[^] is used to do this job. For example below line:
VB
{MACROBUTTON SayHello Say Hello}

displays text Say Hello and executes SayHello procedure (embeded into document).
VB
Sub SayHello()
MsgBox "Hello"
End Sub



Is this what you want to achieve? To use graphic/image as a "button", follow the link above.
[/EDIT]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900