访问Word 2013表中的新插入控件 [英] Accessing the new Insert control in Word 2013 tables

查看:89
本文介绍了访问Word 2013表中的新插入控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MS Word 2013添加了一个漂亮的新插入控件来向表中添加行或列(请参阅http://blogs.office.com/b/microsoft-word/archive/2012/08/30/working-with-tables- in-the-new-word.aspx [ ^ ]和http://blogs.office.com/b/microsoft-word/archive/2012/07/30/introducing-word-2013.aspx [ ^ ])。我有一个Word 2010加载项,我想适应2013年。为了工作,我需要它,加载项需要抑制该控件的外观(即,不让用户看到它)或拦截它的激活(即,通知用户点击它)并回复它(比如 - 对于那些记得TI的触摸和说话的人 - 玩你找到它了!音乐)。除了在上面引用的文章中简要提及之外,我无法在这些控件上找到任何内容。有人可以提供一些指导吗?



对于Maciej Los:我不想做任何事 文档或 文档。我需要与UI进行交互以(1)阻止显示新控件,以便用户不能点击它,或者(2)知道用户点击了该控件(用户添加了一行/列< here>),因此我可以执行其他操作以响应该行/列插入。如果用户单击该插入控件并且我的加载项无法知道它,则项目结束。

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.

推荐答案

在与MS商议后,我们了解到没有提供钩子来抑制此按钮,也不会通知它的执行。但是,它的使用会触发SelectionChanged事件,我们可以将当时的行/列数与我们知道的最后一个计数进行比较。如果它们在正确的方向上不同,则单击该按钮。它似乎很好,但它确实有效。
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.


我不确定我是否理解你,但是......

看看这里:< a href =http://msdn.microsoft.com/en-us/library/vstudio/2dw39e8e.aspx>如何:以编程方式将行和列添加到Word表格 [ ^ ]






我想我现在理解你的问题(修订版3)。我将尝试使用VBA代码向您解释。

假设您要在MS Word文档中添加文本,双击时应与用户进行交互。



在MS Word 2003(及更高版本)中,我们可以使用 Insert-> Fields ... 菜单向文档中添加交互字段。经常 MACROBUTTON [ ^ ]用于做这个工作。例如下面的行:

I'm not sure i understand you well, but...
Have a look here: How to: Programmatically Add Rows and Columns to Word Tables[^]



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:
{MACROBUTTON SayHello Say Hello}



显示文字说你好并执行 SayHello 程序(嵌入到文档中)。


displays text Say Hello and executes SayHello procedure (embeded into document).

Sub SayHello()
MsgBox "Hello"
End Sub







这是你想要达到的目标吗?要将图形/图像用作按钮,请点击上面的链接。

[/ EDIT]




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


这篇关于访问Word 2013表中的新插入控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆