Tuesday, February 21, 2012

Utilizing Quick Parts in Word to Display SharePoint Document Information Panel Metadata

Quick Parts are a feature in Microsoft Word which allow document metadata from Microsoft SharePoint to also be displayed within the body of a Word document. The Document Information Panel (DIP) is a Microsoft InfoPath form that is generated from the SharePoint Document Library and contains the document library’s metadata fields. When the user selects values in the DIP and saves the document back to SharePoint, the metadata fields within the Document Library are also updated. Document metadata can also be useful inside the document itself. This is where Quick Parts come in. Quick Parts are controls that are placed inside the body of the Word document and are connected to the DIP’s metadata fields. When the user selects a value in the DIP, the same value is also placed inside the body of the document via the Quick Part. This also works when the user selects a value from a Quick Part as it enters a value in the DIP. Let’s go through the steps of creating a DIP and adding Quick Parts to a document…

#1 - Create a Document Information Panel (DIP):

**The information below assumes that you have the ability to create/edit Content Types as well as digitally sign an InfoPath form.**

1) Ensure that your Document Library has enabled the use of Content Types.

2) Be sure to add your Content Types to the Document Library. To perform this operation, click on “Add From Existing Content Types” within the Document Library Settings page. For this demo, I am using a Content Type I created called “QuickPartsDemoDoc”.

3) Within the Document Library Settings page, click on the Content Type name and select “Document Information Panel Settings”.

4) You will need to “Create A New Custom Template”. This will open the InfoPath Designer client.

5) Remove any metadata fields you may not need.
**Rimarkable Tip: When using Document Content Types, hide the Title field. You can hide this field within the Content Type settings page as well as remove the control in the InfoPath form you have just created!**

6) Before publishing this form (DIP), you will need to digitally sign the form. Go to File -> Info -> Form Options -> Security and Trust. Check the box to add your certificate. Don’t forget to double check the Security Level of your form before you leave this window.

7) Save the form locally (ex: Desktop). While the form is still open, publish the form by selecting File -> Publish -> SharePoint Server. Follow the wizard to finish the publishing process.

8) Close InfoPath Designer and click “OK” on the DIP settings SharePoint web page that is still open.

#2 - Add Quick Parts to a Word Document

1) Create a new document in your Document Library using your Content Type.

2) Notice that a custom DIP is now associated with your Content Type. I have two fields called “Date Created” and “Version”.

3) Inside the body of your document, place the cursor where you would like the metadata information to be placed. To insert the Quick Part, go to Insert Tab -> Quick Parts -> Document Property -> (Select Metadata Field Here). For this example, I am inserting the “Version” field.

4) Once you have finished inserting Quick Parts, save the document locally
5) Navigate back to Document Library Settings -> (Content Type Name) -> Advanced Settings -> Upload New Template. Upload the template you have just saved locally.
6) Navigate back to your document library and create a new document. Try editing the metadata in the DIP and notice how the body of the document contains the same data!