Macro of the Day: Disable Cap [textInDocument]

A reader recently wrote to us here at Microsoft, and asked us if there was a way to disable the built in command for "Cap [textInDocument]".

Sometimes, for some people, this command can be recognized a little too easily if you’re actually trying to insert text that already exists in the document. So … I thought … Time for another Macro of the Day!

You can disable the built-in command once this macro is in place by saying "Disable Cap [textInDocument]". You can re-enable it by saying "Enable Cap [textInDocument]".

You can download it here in our macro code gallery, or just take a look at it here:



    Author:  Rob Chambers [MSFT]

    What can I say?

      Disable Cap textInDocument
      Enable Cap textInDocument

    How does it work

      For some people, at sometimes, one of the the built-in
      Vista commands ("Cap [textInDocument]") gets accidentally
      recognized when it shouldn’t.

      This macro is a work around for that problem. It "hijacks"
      the recognition for "Cap [textInDocument]" (if the command
      is enabled) and instead just inserts the text in the document.

      The macro also demonstrates how to have another set of
      commands that enables and disables a 3rd command…

<listenFor>Disable cap text in document</listenFor>
<setState name="disableCapTextInDocument" value="1"/>

<listenFor>Enable cap text in document</listenFor>
<setState name="disableCapTextInDocument" />

<command priority="100">
<stateIsSet name="disableCapTextInDocument" value="1"/>
<listenFor>cap [textInDocument]</listenFor>
<setTextFeedback>Inserting text. Say Enable "Cap [textInDocument]" to re-enable…</setTextFeedback>