Microsoft Word has a fantastic feature that lets you embed SharePoint metadata in the document. This really encourages users to fill in the important metadata and lets them do it in the context of the document as they are working on it. You can also do neat things like embed a client or project name throughout a template and have all users of that be updated automatically.
All you have to do is choose Insert|Quick Part|Document Property in Word and it shows a list of all the metadata columns in the associated SharePoint library.
There is a bit of a problem with this however. Frequently your field shows an apparently random number and not the metadata you were expecting. This happens if you choose a field in SharePoint which is a Lookup column.
What’s actually happening is that your SharePoint library actually stores the ID for the item in the lookup list and that’s the number you are seeing instead of the value (Client, Project etc) that you wanted. And here is the reason why…
When you choose this type of Quick Part, Word goes to SharePoint and the Library for the full set of options for that metadata column. The Library then gets this from the Lookup List. However, it does this based on the default view for the List. If your default view in the List does not contain the column you are trying to lookup it can’t complete the action and so just shows the item ID instead.
The fix is relatively easy, once you know this. Just make sure that the default views in the List has any column headings that you might want to embed in your document. The good news is that it’s retroactive – so you can always go back and add extra columns to the view when you need it.
One more step. Edit the default view and find the View Limit setting. It’s often smaller than the number of items in the list and this causes Word to not find the lookup value,at which point it displays the ID instead. Avoid this by setting the limit to something arbitrarily higher than the number of items you will ever have in the list, but less than 5000. Thanks to Andy Bolam who provided this vital insight in the article comments.
So that’s it – just check your lookup lists have the correct columns in the default view. Then crack on and get everyone to fill in the document metadata as they create the document. Of course, they need to have saved the document into the SharePoint library first (even better if they create the documents from within the library in the first place).