Office has a lot of nice features connected to SharePoint, one of them should be a way to insert the version history into your document. Unfortunately there’s no such thing. Maybe because MS wants you use SharePoint when you check the version history. But documents can be taken offline, moved, mailed or whatever and the person reading the document doesn’t necessary have access to SharePoint but still wants to know the story behind the document.
There is no fancy way to do this, not without an Office-Addin and nobody wants that, considering development hours and distribution to clients.
I had to figure out a way to get the document-version-history from SharePoint 2010 into MS Word using SharePoint/Office functionality. This is nothing standard and from what I have found, there is no easy way to do this.
What if I could use a Quick Part to show this? And since fields from SharePoint can be shown as Quick Parts in MS Word, this might be an easy way to do it!?
First I created a hidden field with PowerShell, a Note field with unlimited length and added it to the Content Types used by the documents. You can of course create a feature, console application or likewise to do this.
Do not use $field.Hidden = $true, this will cause the field to NOT appear as a Quick Part.
$web = Get-SPWeb http://server/site
$fieldName = $web.Fields.Add("VersionHistory", [Microsoft.SharePoint.SPFieldType]::Note, $false)
$field = $web.Fields[$fieldName];
$field.UnlimitedLengthInDocumentLibrary = $true;
$field.ShowInDisplayForm = $false;
$field.ShowInEditForm = $false;
$field.ShowInNewForm = $false;
$field.ShowInVersionHistory = $false;
$ct = $web.ContentTypes[%TheContentType%];
$linkField = new-object Microsoft.SharePoint.SPFieldLink $field
When this is done, you will have a field that will not be shown in SharePoint forms, but it will appear as a Quick Part in MS Word.