Random Technical Stuff RSS 2.0
 Tuesday, October 16, 2007

One of the newest features of Word 2007 and MOSS 2007 is a much tighter integration between the two applications, particularly when it comes to metadata.  There is a capability to integrate the metadata into the actual document rather than attach the metadata as an afterthought.  This example shows how to set this up.

Create a document library with the appropriate columns (attributes) you want to track.  In this case I have created document library called Features Requests with columns for tracking Description, Request Date, Status (choice of New, In Process, and Completed), and Priority (choice of High, Medium, and Low).

image

Bring up the Advanced Settings for the document library and click on the "Edit Template" link under the Document Template section.

image

and Word will open in the following fashion:

image

I created a quick shell document to capture the information required.

image

The attributes from MOSS become Document Properties that are exposed as Quick Parts in Word.  Word will respect the data types and try to infer the appropriate content control.  If the data type is a choice in MOSS, Word will create a drop down list.  For a date, Word will create a date picker.  One thing to note is that while I changed the column name for the Title to Description, the Quick Part still calls that data Title.

image

The fully laid out Word document will have the content controls embedded in the document itself and fully connected to the MOSS library.  You can change the properties of the content controls and nest them if you want to lock down certain sections of the document.

image

Now you can save the document and it will update the document template in the document library.  If you return to the document library and create a new document it will use the template that we linked to the document library.

image

As fields are filled in within the document the attributes change

image

As the document is saved back to the document library, all of the attributes are saved back to the columns in the document library.

image

The metadata about the document will fully round trip - if I change the metadata in MOSS, the document will change and vice versa.  If you want to understand the mechanics of this, you can crack open the document (save it locally, rename to use a .zip extension, and open it in explorer) and look at the custom xml folder.  The data is not embedded in the content of the document but is bound via custom xml.

16-Oct-2007 4:41 PM  #   
MOSS | Office | Office Apps

  
Archive
<September 2010>
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789
About the Author/Disclaimer

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

© Copyright 2010
Joe Shirey
All Content © 2010, Joe Shirey