Welcome to MSDN Blogs Sign in | Join | Help

Control Yourself…

Another post, another Word Program Manager… My name is Tristan Davis and over the last 3 years as a Program Manager (or PM if you want to use Microsoft-speak) on the Word team, I've focused on three things:

  1. Losing 60 pounds, joining the Ecma TC45 Technical Committee as the WordprocessingML expert and helping develop it through to the recent final draft, and as a result, gaining back 80 (sigh)
  2. Planning my upcoming wedding to another Word PM (December 18th – two months two days and counting)
  3. Thinking about integrating Word into the world of structured editing and XML

From this point on, I promise I'll only post things about #3 or the parts of #1 that don't involve choosing between protein shakes and cheeseburgers. J (All protein from here till December, though.)

Anyway, on to structured editing. One of the reasons I love Word is that you can do just about anything once you load it up and get that first blank page. For example, open up Word, double-click anywhere on the page and Word will automatically move the cursor there so you can start typing, like this:

In fact, if you click near the center or right side of the page, the cursor will change to something like this or this, and Word will automatically center or right align the text:

Now, that's really cool (it's actually how I centered the two pictures), and it demonstrates just how flexible Word is.

However, that flexibility isn't always what you want when you're creating a document. When we spent time on the road visiting our users, it was a pretty common to see that you actually want control over what's inside a document. I'll spread out what that means over four additional posts:

  • I want to create a document and restrict what people can do with it, for example:
    • A document that contains legal language, and I want to ensure people don't accidentally change or delete any of that text.
    • Create a document with a region in the top left that contains the company logo and can't be removed.
    • Have a region where the date of the meeting goes, including a popup to let the editor pick it from a calendar.
    • Tie a picture and its caption together so they don't get separated.
  • I want to create structured regions of a document that people fill out
    • The top of the report has drop-down lists and date pickers for the important data, but the rest is uncontrolled and generated by the report creator.
    • The cover page of the proposal can't be changed except by filling out the title, author, and so on.
  • I want to give meaning to the contents of a document (i.e. tell the computer what a human could easily deduce)
    • This isn't just some text; it's the date of the conference.
    • That bulleted list is actually the names of the attendees.
    • The location of the title, subtitle, author name and date on a snazzy cover page.
  • I want to get information from another source and have it appear at a specific place in a document
    • My name automatically appears when I insert the cover page.
    • The stock data shows up on the cover page of my stock report.
    • The customer data automatically appears when I create a new invoice.

To do any of this, we needed to give Word the ability for you to restrict its typical "anything goes" nature. The result: Word 2007 introduces the concept of "content controls". Content controls allow you to, unsurprisingly, control content. With these new controls, I can set up a document with form-like UI, as well as set restrictions on what you can do with them.

For example, let's take the legal clause. Here's my document with the standard copyright and legal information:

Now, we don't want anyone changing that legal information, but right now, they can accidentally over-select when they're editing the References and delete it:

Obviously, the text was there for a reason and should not have been deleted, but there's always a chance that some change might happen by accident. In Word 2007 though, the person that created this file can "group" that text and prevent me (or anyone else) from editing it without having to lock down the whole file. Sounds simple – and in terms of how you use it, it is.

The whole reason this is a big deal (and gets me excited) is that like I've said – Word's finally learning how to structure a document and respect the restrictions that you want to put on the contents, in spite of its flexibility, which I'll keep exploring in subsequent posts.

Some Basics

I love to talk about this stuff, but I'm going to hold myself back a bit and leave more for future posts. However, if you're interested and want to start exploring, here's where content controls appear in Word's new UI:

If you look at the Developer tab, the Controls group exposes all seven control types:

  1. Rich Text - Just like any other text in Word, but with its structure, you can start to control its behavior (just like that legal clause).
  2. Plain Text – Allows uniformly formatted text (no bolding a single word, the control's entire contents must be bold).
  3. Picture - Restricts its contents to a single image.
  4. Drop-Down List – A list J.
  5. Combo Box - Just like a drop-down list, except that you can type in your own values as well as choose from the list.
  6. Calendar – Provides a calendar to pick a date.
  7. Building Blocks – Think of this like a rich text drop-down list. Instead of just text, everything in the list can be arbitrary Word content (formatted text, tables, ten paragraphs …).

(By the way, you won't see this tab by default, since we think it's only for people creating documents for others who need to set up these controls/restrictions. To get it:

  1. Click on the Office Button (in the top left).
  2. Click on Word Options.
  3. On the initial page, check "Show Developer Tab in the Ribbon"

This tab is chock full of interesting structured editing features that I'll talk about in the future.)

That's it for now.

- Tristan

Published Monday, October 23, 2006 2:15 AM by wrdblog

Comments

# re: Control Yourself…

This post explains really brielfy what Content Controls can do.  I played with them a little with Office Beta 2 and Office Beta 2 TR and I was wondering if there was a way to add a new content control (Custom Content Control).  Let's say I want to develop my own content control, can I create a class that implement an interface and then that content control would be added to the list.  

Is there any place within the xml generated by these content controls where I could put some Metadata.  I want to be able to store some hidden text, it could be anything but I don't want this text to be shown from anywhere in the document.  Could I extend one of the current Content Control that already exist and add some properties to it?

Thanks alot!

Louis-Philippe

Monday, October 23, 2006 11:44 AM by Louis-Philippe Perras

# More on content controls

I posted earlier this year on the support for custom defined schema in wordprocessingML via the new content

Monday, October 23, 2006 2:44 PM by Brian Jones: Open XML Formats

# re: Control Your Users

So, as a user I want to create a document and restrict what people can do with it.

Or, as a user I want to create structured regions of a document that people fill out.

Or, as a user I want to give meaning to the contents of a document.

These are all things I would like to do, thank you very much.

But by the way, since we think it's only Developers who create documents for others, as a mere User I am supposed to hire a Microsoft Certified Developer any time I want to do these things.

So, why I should buy the program in the first place? Like, if the program is not ready for the User to actually, you know, use?

</rant>

Tuesday, October 24, 2006 8:04 PM by A User

# re: Control Yourself…

Louis-Phillipe, great questions. I'm going to work my way there pretty quickly in these posts, but the short answer is yes - you can have custom XML associated with documents, which the controls then link to.

A User, I'm guessing you're referring to the naming of the developer tab? Even though the name is kind of scary, you definitely do not have to be a developer to use these tools.

Wednesday, October 25, 2006 6:02 PM by wrdblog

# re: Control Yourself…

Hi Folks,

We are a MS Gold Partner with several customers who are moving to MOSS and MS Office 2007. I am creating demo's of MOSS and MS Office integration and have run into a strange problem. I am usinf the B2TR of MOSS and Office for all demos.

I have a MOSS Doc Lib that includes a Content Type with a column, "Customer" that is a lookup through a BDC connection to CRM.

The corresponding Document Information Panel includes a drop-down List Box associated with the "Customer" BDC/CRM data source. The value and display name associated with this drop-down is the Account Name - a string valus.

This MOSS Doc Lib also has an MS Word template associated with this Content Type. The template includes a Content Control (Quick Part)that is associated with the "Customer" drop-down.

When selecting "new" from the MOSS Doc Lib MS Word opens with a Document Information Panel containing a drop-down list of Customer Names. The dop-down is populated with the names from CRM, as expected.

When I select one of the names from the "Customer" drop-down the name is inserted into the template's "Customer" Content Contol, as expected. However I then see a red dotted lin around both the "Customer" drop-down and the "Customer" Content Control and an error message telling me: "Only positive integers allowed".

I don't see any way to tell the "Customer" Content Control that string are the correct type.

Is this a B2TR bug or is there something I need to do to fix this?

Thanks.

Thursday, October 26, 2006 2:02 PM by Larry Somers

# re: Control Your Developers

Yes, the naming of the tools tab, and also the hiding thereof.

"...you definitely do not have to be a developer to use these tools." But you have to be a rather unusual user to overcome the inexplicable anti-discoverability and dis-affordance.

I call it inexplicable because I can not tell whether the intent was to deprecate the role of Users who "...actually want control over what's inside a document" or whether the intent was to diminish the role of Developers to doing what "Sounds simple ... in terms of how you use it" instead of actually, you know, developing applications.

As a user who is also a developer and trainer, I confidently predict that when I show users how to do this most will push back and insist it be done for them, each and every time the need arises.

I fail to see how this lose-lose situation is in anyone's interest. Can you clarify the intent?

Thursday, October 26, 2006 3:57 PM by A User

# re: Control Yourself…

Hi Larry,

Good question - some of our coworkers who are most familiar with the BDC integration are looking into this. I'll keep you posted.

Thursday, October 26, 2006 7:34 PM by wrdblog

# re: Control Yourself…

A User,

Thanks for the feedback. I think it's awesome that you think the tools on this tab should always be shown.

As to why it’s called Developer, good question – we spent a lot of time internally discussing the name of this tab. Believe me, the intent was not to make light of what it takes to develop solutions on top of Word  (rather, we wanted to make sure that the focus of doing so is writing business logic and not wrangling the application’s behaviour). Rather, we realized that there were a set of tools that were likely to be used by more advanced users, and put them all in one place, and this was the moniker for that place we ended up with after a lot of discussion. The fact that it’s not visible by default was mostly a side effect of the fact since we did anticipate this is a more advanced task, we didn’t want to have it there by default adding additional UI for the users who didn’t want it. Now, one could make the same argument about other tabs (e.g. Mailings), but this is where we ended up.

So basically, the intent was to have a set of tools for more advanced users in one place that didn't have to appear for everyone. I love the feedback that this shouldn't be so hidden, though.

Thursday, October 26, 2006 7:56 PM by wrdblog

# re: Control Yourself…

I have a question around documenting a user's agreement/alignment...in either Word or Outlook.  Inside our project management process we create a word document to gain up-front alignment from key stakeholders and project participants around objectives, deliverables, risks, etc.  In our current process, we then route the completed document for manual signature by all the constituents.  This takes a very long time due to the number of parties and dispersed geographies.

I have looked at routing options in Word and voting buttons in Outlook, but I need a SOX-worthy trackable solution.  Do you have any electronic tracking/voting/signature suggestions (short of full-blown electronic signatures...which require added software costs, upfront loading, and training/understanding for all the potential project participants...which is a huge cross-functionalist list from our Fortune 50 organization.)  Thoughts?  Thanks!

Bill

Friday, October 27, 2006 2:47 PM by Bill

# re: Control Yourself…

Thanks for looking into this possible MOSS/Office 12 bug. Being able to populate a Word Document based Content type, in SharePoint, from live data in CRM is very powerful!

Monday, October 30, 2006 1:25 PM by Larry Somers

# re: Control Yourself…

Hi Larry,

We're trying to reproduce this one in-house - can you attach the DIP to a blank document (i.e. remove the controls from the mix altogether) and let me know if you still get an error when you change the selection?

Thanks!

- Tristan

Monday, October 30, 2006 3:06 PM by wrdblog

# re: Control Yourself…

Hi Bill,

When you mention that digital signatures are too complex, have you looked into the signature work done in Office 2007?

If you look under the Insert tab, in the Text group (on the right) there's the ability to insert Signature Lines, which allow someone to sign documents via digital signatures in an end-user friendly way (typing their name, for example).

Tristan

Monday, October 30, 2006 3:10 PM by wrdblog

# Inserting and Swapping Building Blocks

In my first post on building blocks, I talked about the different types of building blocks available

Monday, December 04, 2006 12:14 PM by The Microsoft Office Word Team's Blog

# The power of data-view separation in your documents

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

Wednesday, January 10, 2007 1:02 PM by Brian Jones: Open XML Formats

# Office Open XML File Format Nuggets

My Office Open XML File Format nuggets have all been published at http://www.microsoft.com/uk/msdn/events/nuggets.aspx

Thursday, May 24, 2007 7:09 AM by Mike Ormond's Blog

# Adding content to Word "content control" programmatically

Category: Word programming Level: Advance Here is a small tip on how to add data to Word content control

Thursday, September 06, 2007 11:18 PM by All About SharePoint - S.S. Ahmed - MVP Microsoft SharePoint S.S. Ahmed - MVP Microsoft SharePoint

# The Microsoft Office Word Team's Blog : Control Yourself…

Another post, another Word Program Manager… My name is Tristan Davis and over the last 3 years as a Program Manager (or PM if you want to use Microsoft-speak) on the Word team, I've focused on three things: Losing 60 pounds, joining the Ecma TC45 Technica

Saturday, June 07, 2008 2:35 AM by Relationship Compatibility
New Comments to this post are disabled
 
Page view tracker