Is there a way to detect a mouse click in a Word document in my form?
-
Hi I'm woundering if there is a way to detect a mouse click in a Word document that I have opened in my Form. Many thanks Fia
AFAIK if you call Mouse.Capture()[^] the control specified will get the mouse events, no matter where the mouse is going, or what window has focus. But then, if you hover a Word document, you won't be able to select words, set the caret, or do anything to it. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum iSad
-
AFAIK if you call Mouse.Capture()[^] the control specified will get the mouse events, no matter where the mouse is going, or what window has focus. But then, if you hover a Word document, you won't be able to select words, set the caret, or do anything to it. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum iSad
Hi Thank you for the answer. Can you give me a code example. The only thing I want to know if the users click on the word document. I'm using these objects
ap = new Word.Application();
doc = ap.Documents.Open(path, ReadOnly: false, Visible: true);Many Thanks Fia
-
Hi Thank you for the answer. Can you give me a code example. The only thing I want to know if the users click on the word document. I'm using these objects
ap = new Word.Application();
doc = ap.Documents.Open(path, ReadOnly: false, Visible: true);Many Thanks Fia
fiaolle wrote:
Can you give me a code example
I don't have any. I suggest you read MSDN, and use Google. It has nothing to do with Word, Mouse.Capture is a general-purpose tool. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum iSad
-
fiaolle wrote:
Can you give me a code example
I don't have any. I suggest you read MSDN, and use Google. It has nothing to do with Word, Mouse.Capture is a general-purpose tool. :)
Luc Pattyn [My Articles] Nil Volentibus Arduum iSad
-
Hi I'm sorry I haven't found anything that helps me or I'm not understanding the examples. Is there anybody who can help with some code how to do this. Please Thanks Fia
Hi :-D Thanks for all the replies. I have found a solution. Microsoft.Office.Interop.Word.Application ap; Microsoft.Office.Interop.Word.Document doc;
ap = new Word.Application();
ap.WindowSelectionChange +=new ApplicationEvents4_WindowSelectionChangeEventHandler(ap_WindowSelectionChange);
doc = ap.Documents.Open(path, ReadOnly: false, Visible: true);private void ap_WindowSelectionChange(Microsoft.Office.Interop.Word.Selection Sel)
{
}When I click in the doc I have opened the event ap_WindowSelectionChange runs. Fia