事件列表 +-------------------------------------------------------------------------------+ | 事件 | 描述 | +-------------------------------------------------------------------------------+ | Close | Occurs when a document is closed. | +-------------------------------------------------------------------------------+ | DocumentBeforeClose | Occurs immediately before any open document closes. | +-------------------------------------------------------------------------------+ | DocumentBeforePrint | Occurs before any open document is printed. | +-------------------------------------------------------------------------------+ | DocumentBeforeSave | Occurs before any open document is saved. | +-------------------------------------------------------------------------------+ | DocumentChange | Occurs when a new document is created, when an | | | existing document is opened, or when another | | | document is made the active document. | +-------------------------------------------------------------------------------+ | DocumentOpen | Occurs when a document is opened. | +-------------------------------------------------------------------------------+ | GotFocus | Occurs when the focus is moved to an embedded | | | ActiveX control. | +-------------------------------------------------------------------------------+ | LostFocus | Occurs when the focus is moved from an embedded | | | ActiveX control. | +-------------------------------------------------------------------------------+ | New | Occurs when a new document that is based on the | | | template is created. A procedure for the New event | | | runs only if it is stored in a template. | +-------------------------------------------------------------------------------+ | NewDocument | Occurs when a new document is created. | +-------------------------------------------------------------------------------+ | Open | Occurs when a document is opened. | +-------------------------------------------------------------------------------+ | Quit | Occurs when the user quits Word. | +-------------------------------------------------------------------------------+ | WindowActivate | Occurs when any document window is activated. | +-------------------------------------------------------------------------------+ | WindowBeforeDoubleClick | Occurs when the editing area of a document window | | | is double-clicked, before the default double-click | | | action. | +-------------------------------------------------------------------------------+ | WindowBeforeRightClick | Occurs when the editing area of a document window | | | is right-clicked, before the default right-click | | | action. | +-------------------------------------------------------------------------------+ | WindowDeactivate | Occurs when any document window is deactivated. | +-------------------------------------------------------------------------------+ | WindowSelectionChange | Occurs when the selection changes in the active | | | document window. 这个可能对你有用 | +-------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------+
| 事件 | 描述 |
+-------------------------------------------------------------------------------+
| Close | Occurs when a document is closed. |
+-------------------------------------------------------------------------------+
| DocumentBeforeClose | Occurs immediately before any open document closes. |
+-------------------------------------------------------------------------------+
| DocumentBeforePrint | Occurs before any open document is printed. |
+-------------------------------------------------------------------------------+
| DocumentBeforeSave | Occurs before any open document is saved. |
+-------------------------------------------------------------------------------+
| DocumentChange | Occurs when a new document is created, when an |
| | existing document is opened, or when another |
| | document is made the active document. |
+-------------------------------------------------------------------------------+
| DocumentOpen | Occurs when a document is opened. |
+-------------------------------------------------------------------------------+
| GotFocus | Occurs when the focus is moved to an embedded |
| | ActiveX control. |
+-------------------------------------------------------------------------------+
| LostFocus | Occurs when the focus is moved from an embedded |
| | ActiveX control. |
+-------------------------------------------------------------------------------+
| New | Occurs when a new document that is based on the |
| | template is created. A procedure for the New event |
| | runs only if it is stored in a template. |
+-------------------------------------------------------------------------------+
| NewDocument | Occurs when a new document is created. |
+-------------------------------------------------------------------------------+
| Open | Occurs when a document is opened. |
+-------------------------------------------------------------------------------+
| Quit | Occurs when the user quits Word. |
+-------------------------------------------------------------------------------+
| WindowActivate | Occurs when any document window is activated. |
+-------------------------------------------------------------------------------+
| WindowBeforeDoubleClick | Occurs when the editing area of a document window |
| | is double-clicked, before the default double-click |
| | action. |
+-------------------------------------------------------------------------------+
| WindowBeforeRightClick | Occurs when the editing area of a document window |
| | is right-clicked, before the default right-click |
| | action. |
+-------------------------------------------------------------------------------+
| WindowDeactivate | Occurs when any document window is deactivated. |
+-------------------------------------------------------------------------------+
| WindowSelectionChange | Occurs when the selection changes in the active |
| | document window. 这个可能对你有用 |
+-------------------------------------------------------------------------------+
我在word中点击鼠标或者通过键盘移动使光标位置发生变化,有没有什么事件能够监听到光标的位置,以便于我可以根据光标的位置不同,来进行不同的操作,如果能够贴下代码的话那就最好啦,主要是学习c#没多久,很多都不懂。
WindowSelectionChange这个事件应该是可行的,就是具体代码不知道该怎么写
不是很懂,捕捉光标的问题ms要用hook