Home Page

 


EARLIER FEATURES

 


FEATURES CONTENTS

 


LATER FEATURES

 

Features Contents


26th November 2006

RICH TEXT CONTROLS

Brian Grainger

email.gif (183 bytes)
brianATgrainger1.freeserve.co.uk


 

As time moves on and I get to know more and more about Windows there is less and less to discover and write about. This week, having finally got exasperated with a long standing problem, I did some investigation and uncovered a new topic, that of Rich Text Controls, and the purpose behind one of those mysterious files in the Windows System folder.

It all started with WordPad. I use WordPad for general purpose editing needs. It is quicker to load than Microsoft Word, yet supports Rich Text Formatted files, (.RTF). This allows quite sophisticated files to be created, especially when compared to Notepad.

If you load an RTF file created with another application, such as Microsoft Word or Microsoft Outlook, you will see that WordPad will display files with embedded tables, indented paragraphs, bullet styles as well as variable line spacing and paragraph spacing. It is the latter that has been the long standing problem.

Those of you who have written HTML pages will know that if you use the <p> and </p> to delineate paragraphs then there is a single line space between each paragraph. Copy such text to WordPad and the spaced paragraphs are preserved. However, if you try to type a new file there seems to be no way to create such paragraph spacing. If you look on the WordPad paragraph formatting options then all that is available is indentation and alignment, not paragraph spacing.

Having looked on the web to try and solve the paragraph spacing problem in WordPad I discovered a related problem - that of double spacing lines. Sadly, it seems the paragraph spacing problem cannot be solved, but pressing CRTL-2 will create double spaced lines. I have to admit that this tip was not widely known on the web. I got intrigued and wondered whether there were other keyboard functions that would work.

Rather than start pressing random key combinations to see what they did, I got out my list of Microsoft Word keyboard shortcuts. There are a lot of them but I went through each one to see which worked in WordPad. The results were intriguing and also a bit haphazard in what is and is not implemented.

The following gives a resume of my findings. I have excluded those, such as File and Edit commands, that are mentioned in the WordPad menus.

  • The move and select functions are implemented.
    e.g. CTRL-RIGHT will move one word to the right. CTRL-HOME will move to the beginning of the document and CTRL-END will move to the end. Similarly CTRL-SHIFT-RIGHT will select the next word, CTRL-SHIFT-HOME will select all text to the beginning of the document, etc.
  • CTRL-NumPad5 / CTRL- CLEAR both perform the same function - select all text. This is the same as CTRL-A, which is mentioned on the Edit menu.
    Note: The CLEAR key is the numeric keypad 5 when numlock is NOT selected.
  • CTRL-L / CTRL-R / CTRL-E will align paragraphs left, right and centre.
  • CTRL - = will subscript text
  • CTRL-SHIFT - = will superscript text
  • CTRL-1 / CTRL-5 / CTRL-2 gives single, 1.5, double line spacing respectively
  • CTRL-' / CTRL-` / CTRL-, / CTRL-; / CTRL-SHIFT-6 gives a grave accent, acute accent, cedilla, umlaut, circumflex on the following letter (UK Keyboard)
  • CTRL-BACKSPACE deletes previous word
  • CTRL-INSERT / SHIFT-INSERT will copy and paste
  • INSERT toggles Insert/Overwrite mode.
  • CTRL-SHIFT-> / CTRL-SHIFT-< increases and decreases font size of selected text
  • CTRL-SHIFT-L toggles various bullet styles

I think you will agree that the list above is a fairly motley collection of functions - none more so than the last two. The only bullet style that can be selected from the WordPad menus or toolbar is similar to that used in the list above. However, using CTRL-SHIFT-L you can select numeric, lower case alpha, upper case alpha, roman and upper case roman styles. What is more, Word does not do this. Pressing CTRL-SHIFT-L will just select the basic bullet type.

While I knew of much of the functionality above the new bits I found out, in particular CTRL-SHIFT-L, intrigued me. I googled for CTRL-SHIFT-L and found out all about Rich Text Controls.

Rich Text Controls are implemented by a DLL file in the Windows System folder. The filename varies depending on the version used.

Version

Filename

Windows Version in which first appeared

1

Riched32.dll

Windows 95

2

Riched20.dll

Windows 98

3

Riched20.dll

Windows ME / 2000 / XP

4.1

Msftedit.dll

Windows XP SP1

The Version 3 must have been included with something else, probably an Internet Explorer upgrade, because it appears on my Windows 98 machine.

The functionality of Rich Text Controls has increased from version to version - but why it includes some things and not others seems to suggest it has been developed as an 'I forgot it' application! For example, why are the indenting commands of Microsoft Word not included, (CTRL-M, CTRL-T and the equivalent SHIFT commands). Similarly, why the inclusion of CTRL-1, CTRL-5 and CTRL-2 but not CTRL-0. The latter is the paragraph spacing command I needed to solve my original problem! Perhaps these will come in Version 5.

Anybody who is interested in Rich Text Controls in detail, including how to call them in your own applications, can refer to the following page on the Microsoft Developers Network:

http://msdn2.microsoft.com/en-us/library/ms651760(d=printer).aspx

You can also refer to that page for further keyboard shortcuts - such as the tilde accent, (which is not accepted in WordPad but works in Microsoft Word), and how to incorporate Unicode characters.


 

 

 

 


TOP