![]() |
KnowBrainer Speech Recognition | ![]() |
Topic Title: How to create a command to remove highlight from a selection in Microsoft Word? Topic Summary: Created On: 11/12/2021 01:08 PM Status: Post and Reply |
|
![]() |
![]() |
- wristofdoom | - 11/12/2021 01:08 PM |
![]() |
![]() |
- Matt_Chambers | - 11/12/2021 02:49 PM |
![]() |
![]() |
- wristofdoom | - 11/12/2021 03:09 PM |
![]() |
![]() |
- Matt_Chambers | - 11/12/2021 03:48 PM |
![]() |
![]() |
- Alan Cantor | - 11/12/2021 08:09 PM |
![]() |
![]() |
- wristofdoom | - 11/15/2021 06:49 PM |
![]() |
![]() |
- Matt_Chambers | - 11/16/2021 11:11 AM |
![]() |
|
I have a Microsoft Word command called "remove highlight" that makes use of the "alt" hotkeys and the Word command ribbon. So my command was as follows:
Sub Main SendKeys "%h" Wait 0.1 SendKeys "i" Wait 0.1 SendKeys "n" End Sub
But now I have a conflicting command from an Autohotkey script that uses %h.
I don't want to disable this Autohotkey script, because it's useful in Microsoft Word as well as in other contexts.
So I'm wondering, is there a more direct way to activate the "remove highlight" function in Microsoft Word?
I would love to program the remove highlight function in Microsoft Word to some hotkey, like ^%+h and then be able to activate it via both my voice command and the keyboard.
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
Looking back through my old commands, I see this:
Selection.Range.HighlightColorIndex=wdNoHighlight You could create a Microsoft Word macro, using that text, and assign a hot key combination to it. You also could use an Advanced Scripting command, using the same language, with a reference to the Microsoft Word object library. Disclaimer: I haven't used this command in quite a few years. I expect it still works, but no guarantees. |
|
|
|
![]() |
|
Thanks--Not sure about this part.
> with a reference to the Microsoft Word object library. I have heard about this but don't know how to lookup what that looks like. Sub Main { some "reference" code here? } Selection.Range.HighlightColorIndex=wdNoHighlight End Sub Something like this? ------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
In the MyCommands Editor, with the cursor in the Script field, say "press alt enter". After a few seconds, you will get a box with a long list of possible object references. You need to scroll all the way down to Microsoft Word and check the box for that.
You won't see any reference code in your actual script, unfortunately. |
|
|
|
![]() |
|
Instead of Alt+H, try Alt followed by H, or even better, F10 followed by H:
Sub Main SendKeys "{F10}" Wait 0.1 ' This delay may or may not be necessary SendKeys "h" Wait 0.1 SendKeys "i" Wait 0.1 SendKeys "n" End Sub |
|
|
|
![]() |
|
------------------------- Dragon Professional Individual v15.6. Windows 10. Knowbrainer 2017. |
|
|
|
![]() |
|
yes, it's very useful. When I used to work regularly in Microsoft Word, I triggered all sorts of Microsoft Word macros using the object library reference. It was about the only thing that made using Microsoft Word bearable. |
|
|
FuseTalk Standard Edition v4.0 - © 1999-2022 FuseTalk™ Inc. All rights reserved.