Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a situation where I need to have version number on each document in version controlled document library. Having version number on printed sheet would help to see the validity of document.

I did read following which helped me in setting up label for word document but I need to do same for excel spreadsheet and if possible for Visio diagram. http://stackoverflow.com/questions/508229/how-can-i-include-value-of-sharepoints-version-column-in-a-word-document/590444#590444

share|improve this question
Did you try following those steps but instead of using a Word document, using an Excel file? My assumption is the process is probably 99% the same, just wondering if my assumption is wrong. –  shufler Nov 29 '11 at 22:46
I though same initially but With word you get button "quick parts" under insert ribbon, through which you can add document property label. where as with excel there is no button for quick parts. As you have turned on the information management polity for label you do get a label button under insert ribbon in excel but it does not work. –  Digant Nov 30 '11 at 0:27
The text section on the insert tab is screaming for a Quick Parts button... Too bad :( –  shufler Nov 30 '11 at 1:38

2 Answers 2

Here is the answer for Excel. A similar solution should work for Visio.

Create a new column in your library called "SPVersion". Use SharePoint Designer to create a workflow that copies the file version ("Current Item" "Version") to your SPVersion column. In Excel, add the following VBA code to the ThisWorkbook module:

Private Sub Workbook_BeforePrint(Cancel As Boolean)
  Dim wb As Workbook
  Set wb = ThisWorkbook
  For Each prop In wb.ContentTypeProperties
    If prop.Name = "SPVersion" Then
      SPVersion = prop.Value
      Cells(1, 1).Value = SPVersion
    End If
  Next prop
End Sub

This code will run when the workbook is printed and it'll put the value from your SPVersion custom column into Cell 1:1.




share|improve this answer

It appears that Quick Parts are not available in Excel, though the rumblings on the webs suggest maybe they should be...

While not the same (but similar), you could set up the document library as suggested in the SE post, and then create a template in the document library that contains the VBA function listed on this page. I haven't tried it myself, but in theory if you use the same property you define in the library, it may work.

Edit: As per Diego Hillesheim's comment the link is broken due to a PHP error. Neither Google nor the Way Back Machine have a cached copy. I should have quoted the relevant section here. :(

share|improve this answer
Built-in document property does not have version as a property field to display. –  Digant Nov 30 '11 at 5:05
The link is broken –  Diego Hillesheim Jun 11 at 11:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.