Word X: Minor bug becomes major irritant

Posted by Pierre Igot in: Microsoft
April 1st, 2003 • 6:42 pm

A typical situation in MS Word. I use a French-Canadian keyboard, whose layout is significantly different from the US English layout: some keys are in a different location, there are added keys for common accented French letters, etc. While not perfect, the French-Canadian keyboard layout (also known as “Canadian CSA”) is much better than the French-from-France keyboard layout, with many more accented characters accessible in a more direct way.

I am also a word-processor user who tries to use his word processor in the way it was intended to be used — if such a thing as “intention” can legitimately be used to describe what presided at the inception of a software monster such as Microsoft Word.

For example, I religiously use the “Keep with next” formatting option in Word to ensure that consecutive paragraphs stay together and are never separated by an automatic page break. There is nothing more embarrassing than a text heading appearing at the bottom of page X and the corresponding body text appearing at the top of page X+1. Yet it happens all the time in Word documents I receive, because people don’t know about the “Keep with next” option and how to use it.

(Incidentally, I find that, when I take the time to explain to people what the option is for, they do not have much difficulty grasping the concept and see quite clearly how beneficial using the function can be. Most people don’t use it simply because they are not aware it exists.)

In order to make the function more accessible, I’ve customized Word X with toolbar buttons and keyboard shortcuts. The following toolbar buttons are respectively, from left to right, for “Keep with next”, “Keep lines together”, and “Keep with next and lines together”.

A picture named WordX-KeepOptionsButtons.gif

The first two can be added directly through Word’s “Customize” command. For the third one, I first had to create the following macro:

Sub keepWithNextAndTogether()
'
' keepWithNextAndTogether Macro
' Macro recorded 20/10/98 by Pierre Igot
'
 Selection.ParagraphFormat.KeepWithNext = wdToggle
 Selection.ParagraphFormat.KeepTogether = wdToggle
End Sub

As you can see, this is something that I did long ago. I also drew the toolbar button icons myself using Word 98’s built-in icon editor. Of course, Microsoft developers, in their infinite kindness, removed the custom-icon capabilities from the first version of Word X altogether, which means that all the button icons that I had painstakingly painted myself automatically reverted to indistinguishable generic icons… I was not too pleased.

In Word X SR1, they restored the custom-icon capabilities, but did not provide an icon editor, claiming that you could just edit the icon in your favourite graphics program and then paste it into Word. What they didn’t say is that they also added an automatic anti-aliasing filter that totally screws up what you just have drawn before pasting it — which explains why the icons above don’t look very good. (They looked much better in Word 98/Word 2001.) Grrrr…

All this to explain where the buttons in this screen shot come from. Fortunately, since the first two buttons are actually built-in Word commands that are simply not accessible directly in Word’s default configuration, the corresponding toolbar buttons actually behave like they should, i.e. when the option is ON, the button looks depressed, and when the option is OFF, the button is in its default state. For example, in this screen shot:

A picture named WordX-KeepOn.gif

the first option (Keep with next) is ON, whereas the second one (Keep lines together) is OFF.

Unfortunately, there is no way for the user to control the behaviour of custom-made buttons that do not correspond to built-in commands, but actually refer to user-defined macros. In other words, I cannot make my third button (the one that combines Keep with next and Keep together) look depressed, even when both options are actually ON.

What gets really annoying, however, is what happens with the keyboard shortcuts that I have assigned to these three commands. Since these options are used all the time, and not just in style definitions, they need to be accessible directly both through toolbar buttons and through keyboard shortcuts. My shorcuts all use the forward-slash key that is right below the escape key on my French-Canadian keyboard. They are the following:

cmd-/ = toggle Keep with next ON/OFF
ctrl-/ = toggle Keep lines together ON/OFF
ctrl-cmd-/ = toggle Keep with next AND Keep lines together ON/OFF together

Makes sense, right? It works fine, and I can use all three commands without leaving the keyboard.

The problem with these keyboard shortcuts is simple: Since Word X is first and foremost a US program developed by US engineers for US users, it has only been superficially altered to support non-US English keyboard layouts. I can type in Word using my French-Canadian keyboard (thank God!), but the underlying technology that controls the handling of keyboard shortcuts for commonly-used commands has not been altered to handle non-US English keyboards. And, for some reason, the key for E with an acute accent (É) on my French-Canadian keyboard, which is located between the period key and the shift key on the right-hand side:

A picture named KeyCaps.gif

is interpreted by that underlying keyboard shortcut engine in Word X as a… forward slash.

This means that, each time I accidentally hit cmd-É while typing — and this happens to me quite a bit — Word applies the “Keep with next” formatting option to the paragraph in which I am typing, even though I never meant to do this — and I don’t necessarily notice it right away.

Of course, the consequence of this is that my documents are littered with paragraphs in which the “Keep with next” option is ON when it shouldn’t be — and this can create major headaches with unexplained page layout issues that I can’t understand until I realize that I’ve accidentally applied the “Keep with next” option to the offending paragraphs.

In other words, this apparently “minor” bug in Word X, in which the underlying engine for detecting and interpreting Word keyboard shortcuts is not aware that I am using a non-US English keyboard, turns out to be a major annoyance.

Of course, I could change my keyboard shortcuts to something that does not get triggered so easily by accident. But the problem is that I’ve developed a habit of using these keyboard shortcuts, and it would take quite a bit of retraining… As well, I just hate the idea of having to refrain from using certain keyboard shortcuts just because Word X suffers from an obvious bug.


2 Responses to “Word X: Minor bug becomes major irritant”

  1. Pierre Igot says:

    Cool :). Regarding “Keep” options and tables, please note this, however.

  2. Jay says:

    I love you!

    I have been attempting to keep some tables together in word.
    The word doc is created by a VB6 application.

    Word seems to ignore the table property AllowPageBreaks half the time, and it was really beginning to tick me off.

    After reading your blog, I added these 2 lines of code to my app

    m_oWordApp.Selection.ParagraphFormat.KeepTogether = wdToggle
    m_oWordApp.Selection.ParagraphFormat.KeepWithNext = wdToggle

    And now the tables all stay together.

    Thank-you, Thank-you, Thank-you.

    – Jay

Leave a Reply

Comments are closed.