question

AZaki-7140 avatar image
0 Votes"
AZaki-7140 asked AZaki-7140 edited

WdInformation.wdWithInTable will cause the mouse cursor to reappear in MS Word

Hi all,

I'm facing this issue with my word addins. I've added a hook to intercept keypress in MS Word using the SetWindowsHookEx with code from detecting-text-changes-in-word-2016-from-vsto-add-in



BY default MS Word will hide the mouse cursor when a user start typing. I'm using range Information like below to check if the current selection is inside a table or not.

 Dim selRange As Microsoft.Office.Interop.Word.Range = Globals.ThisAddIn.Application.Selection.Range
    
 If Globals.ThisAddIn.Application.ActiveDocument.Content.Text.Length > 0 AndAlso selRange.Information(Microsoft.Office.Interop.Word.WdInformation.wdWithInTable) = False Then
        
     ---some code
        
     End If

The above condition will make the mouse cursor to reappear, which I want to avoid. But with the following code, the mouse cursor remain hidden when typing.

  If Globals.ThisAddIn.Application.ActiveDocument.Content.Text.Length > 0 Then
        
     ---some code
        
  End If

Why does the first code quote behave like that? How to make the mouse cursor remain hidden while typing and only appear if I move the mouse?

Thank you.


office-vsto-com-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

0 Answers