Lookup fields in Word documents

A few days ago I tried to use a SharePoint Lookup field as a Quick Part in a Word document. Doing this I came across two issues:

  1. Not all lookup values can be selected in the Word document;
  2. If I change a lookup field using the edit form of the document, the Word document is updated with the ID of the lookup item, not the value.

It took me a while to figure out what’s going on. When looking at the default view of the lookup list it became clear. All the items, visible in the default view, can be selected in the Document Information Panel, no more, no less. I know it’s odd, but if you know it, it’s quite nice, because this enables you to apply a filter or to use a different sort order in your document.

The issue with displaying the ID instead of the value has the same cause: If you select a lookup value in the edit form, this cannot be selected in your Word document, as it’s not displayed in the default view of the lookup list, so the ID is displayed in Word, as Word doesn’t know the corresponding value.

With that in mind I decided to configure the default views of all lists, I use as a lookup list in my document library, without a row limit. If there is a lot of items, this can cause a very bad performance when users open this list. To prevent this, I configured URL Rewrite in IIS to redirect all responses to a “2nd default view” I created with a row limit.