Jun 07 2022 08:35 AM
In the work which I do with MS Word, I need to type quite complex sentences with lots of bracketed text in them - sometimes 'nested'. For example:
and I want to find an easy way the ensure that the brackets (or parentheses or square brackets) remain balanced (a 'close bracket' to match each 'opening bracket'). To help me with this I have made entries into the autocorrect table such that if I type an opening bracket "(" it is replaced with an opening bracket followed by a closing bracket "()" and then try to remember to hit the 'left arrow' key afterwards. Once I have completed a document I then just 'find' the latter (e.g., "()") and this at least shows me where I forgot to hit the 'left arrow' key and I can then make the necessary adjustments manually before saving the document.
It would be really good though if I could include the 'left arrow' key into the autocorrect text - does anybody know how to achieve that?
Failing that, if the Microsoft developers ever read this entry, may I suggest an enhancement whereby an extra checkbox is placed in the autocorrect dialog saying something like "Include balanced brackets?" (a bit like the 'smart quotes' checkbox) and it does the necessary automatically - thanks
Jun 07 2022 10:35 PM - edited Jun 07 2022 11:18 PM
@LimehouseJohnYou could assign a macro containing the following code to the keyboard shortcut e.g. ALT+9
With Selection
.InsertBefore "("
.InsertAfter ")"
.Collapse wdCollapseStart
.MoveRight wdCharacter, 1
End With
and, for [ ], have another one containing the following code assigned to ALT+SHIFT+9
With Selection
.InsertBefore "["
.InsertAfter "]"
.Collapse wdCollapseStart
.MoveRight wdCharacter, 1
End With
You could use a similar macro with { } for a pair of curly braces, assigned to, say ALT+CTRL+9
To make suggestions for changes to Word, use the Feedback facility accessible by clicking on the Help tab of the ribbon.
Jun 08 2022 01:16 PM
@Doug_Robbins_Word_MVPThat's perfect and works well - thank you very much.
I don't suppose that you know how I could get the identical keyboard shortcuts into Outlook (365) for when I'm writing an email perchance - I should be really grateful if you did.
Thanks very much - even if you don't.
Best regards
LimehouseJohn
Jun 08 2022 03:24 PM