Microsoft Word 2010

The official blog of the Microsoft Word product team

Meet the Controls

Meet the Controls

Rate This
  • Comments 8

So in the last post, we went over what I mean by the concept of structured editing in Word. I deliberately skipped over the awesome work we did in this same space in Word 2003, and I'm going to keep saving that for the future. In this post, I want to finish my first thought and go through the types of controls, and what they're capable of/useful for.

Content Controls in Word 2007

In the first post, we talked about how within the Developer tab, the Controls group exposes all seven control types:

Let me talk a little bit more about how we decided on that set, and what each of them do, starting in the top left.

  1. Rich Text – A lot of people think this control saves content in the Rich Text Format (RTF). Although it's a neat idea, this control is actually designed to allow content controls to span just about anything that you can create in Word (tables, text boxes). The only restriction is that the control must either contain >1 paragraph; or exactly 1 or more paragraphs. Don't worry though, Word won't let you break that rule – we'll move the control if you're going to do something invalid to the closest possible match.
  2. Plain Text – This control is based on the rich text content control, but applies a few additional restrictions:
    1. It can be anything up to and including one paragraph, but doesn't allow multiple paragraphs.
    2. The contents of the control have to be formatted uniformly – so this text works, but this text would not be allowed. It doesn't mean *no* formatting, just that it all has to be the same. Again, Word makes sure of this. J
  3. Picture – The control can only contain a single picture. If there's no picture, a button appears to let you select one directly within the document. That picture can have all of the new Word 2007 effects applied to it, though.

  4. Drop-down List – A drop-down list. Also inherits the plain text control restrictions.

  5. Combo Box – A drop-down list that also allows you to type directly in it if you don't like the choices. This control inherits from the plain text control. Within a combo box, you use the Properties dialog to specify the pre-defined entries for the drop-down list.
  6. Date Picker – Provides a visible calendar for the user to pick a date, or they can type it in directly. Also inherits the plain text control restrictions.

With this control, you can also use the properties to set how the date should look – 1/1/06 vs. January 1, 2006 vs. Jan 2006; and also what language the calendar and date text should appear in (Avril vs. April).

  1. Building Block Gallery – This one is the hardest to explain fully, and not coincidentally, it's also the coolest. We need a post on building blocks before this makes sense, but I like to think of it as a combo box, where the pre-defined choices aren't just text strings, but rather rich blocks of content. For example, a choice between three different legal clauses within a contract.

Beyond that, all of the controls also share a set of common properties:

  • Locking – Each of the controls supports a granular set of locks (preventing deletion of the control itself and/or preventing the content from being edited) as discussed in this post
  • Titles – Each control can have an optional user-friendly title displayed when the control is edited, like this:

  • Tags and IDs – If you're developing a solution based on Word 2007, each of these controls can has a document-level unique ID that can be used to uniquely identify it, as well as an optional tag string.
  • Placeholder Text – The instructional text displayed when the control is blank can be customized into whatever you want (both text and formatting). More on this part later.
  • 'Self-Destruct' – Any of the controls can be set to auto-delete themselves when their contents are edited (so you can have a one-time only date picker, for instance).

But Why?

Now, why that set? When we set out to add more structured editing capability to Word, we spent a lot of time looking at what it meant to structure a *document* vs. building a form. That thinking led us into a lot of research about what it means to have form-like UI within a rich document, whose printed output is also extremely important.

You can see the set we ended up with in my list above, but the biggest outcome of our thinking was the way in which we added the form UI to the Word document. If you play with the controls in a document, you'll notice that when you're not editing them, there's no UI at all distinguishing them from regular content ( in other words, the frame above only appears when you're inside the control's content) – a big goal for us when we set out, and the subject of my next post.

- Tristan

  • Sorry, but I can't seem to sort out what you mean by "the control must either contain >1 paragraph; or exactly 1 or more paragraphs."

  • Good question - sorry, I wasn't very clear on that point.

    What I mean is that (and maybe it wasn't worth mentioning) the control can't start in the middle of one paragraph and end in the middle of another.

    Does that make more sense?

    - Tristan

  • The paragraph after 6 is numbered 1. Not very good demonstration on the use of auto numbering in Word.

  • I wonder if it is possible to make cross reference links easily in the new Word? I'm thinking a situation like if I was writing a book with Word and somewhere in the text I wrote "... as we have seen in the picture 3.3 in chapter 3 XYZ..." and then if the identification -– the number -- of that picture changes, all the references would be updated automatically so that it would say something else instead of "picture 3.3 in chapter 3 XYZ". Also it would be good if all the changes would be highlighted if there was a need to adjust spelling (in morphing linguistic systems).

    Of course it would be nice if anything could be made an object like that. Or is there a better place to ask something like this? I was actually browsing some information how to achieve this painlessly in Word 2003, in vain thus far.

    This is a nice blog concerning the new features in Word, very nice indeed. :-)

  • Alex - good catch, it looks like the XHTML output was in error. (FWIW, in Word the post looks correct - I promise.) <g>

    Veikko - This is definitely possible, if you are using Word 2007 and look on the References tab, you can add a Caption to each picture/table (on the Captions group), which will automatically update as the picture's ordinality changes, and use the Cross-Reference button next to Insert Caption to insert a reference to the appropriate chapter. Good idea for a future post.

    - Tristan

  • Can you let us know the reason for omitting check boxes and option buttons from the set of content controls? I know I'm going to have to explain it to users in the newsgroups, and so far I don't understand it myself.

    The legacy ActiveX controls don't work well, especially because they trigger the macro security warning. The legacy Forms check boxes require form protection, and there isn't any option button in that set.

    I know we could use the dropdown with only Yes/No or On/Off choices, but that seems to be clumsy compared to a check box.

  • There is an excellent post over on the Word team blog that goes into details on how the new content controls

  • One of the most common requests we hear related to word processing documents is the ability to merge

Page 1 of 1 (8 items)