How can I include value of sharepoint's version column in a word document?
Asked Answered
K

8

30

I'm trying to work out a way to display the contents of the version column from SharePoint (i.e. the value that changes every time a file is checked in) as a field (or something similar) inside of a Word document.

Ideally, I'd like to know how to configure SharePoint so I could click something like "Insert > Quick Parts > Document Property > Version", and it would include the version in the document. The goal is to make it easier for someone to correlate a printed version of a document with the version history of SharePoint.

I have been able to add editable text columns to the Document content-type and have them show up as document property quick parts. I've also been able to add a calculated column which gets the version as a text string... however this calculated column isn't showing up in Word as a document property. (Perhaps I'm missing a setting on the calculated column)

Katowice answered 3/2, 2009 at 18:3 Comment(0)
P
28

This is one way to get the version in your document, it's a bit painful to get it working...

  • Enable versioning and content types on your document library.
  • Go into document library settings and select the content types you want the version to appear in.
  • Select Information management policies settings from the content type menu.
  • Select define a policy and click .
  • Click on the 'Enable Label' Check box
  • Do not Check the other two boxes in the Labels section.
  • In the Label Format field, enter the metadata fields in the following format:

     Version : {Version} \n
    
  • Set the label appearance and click on preview.

  • Click at the bottom of the page.
  • Go back to the library and create a new document using the content type you have modified.
  • Save the file as a Word 2007 format.
  • Select the insert tab
  • Select Quick Parts from the Ribbon menu and hover over document property
  • Select Label from the properties list
  • This should display the metadata defined in your label as a field in your word document. The field will update automatically when you next open the document.
  • Save.
Peahen answered 26/2, 2009 at 13:3 Comment(8)
I have to say, I've seen this work before, but it's not working for me today. The 'Label' field isn't available in the drop-down, despite them being enabled in the list. :(Pacifically
@PaulRussell, I don't think this works in later versions of SharePoint/Office.Signac
@JulianKnight Is there a new way to do this in later versions of SharePoint/Office then? Also, I have been unsuccessful to get the SharePoint version to show up on our excel sheets, any tips there? The info is visible in the "File > Info > Manage Version" so it should be possible no?Booby
@Geert: There is still no native way of doing this! There is an addin for SharePoint that works by maintaining a separate version field. It's free and is called Show SharePoint Version in Office Documents. It's the best solution I've come across. It should work with Excel too but I've not tried it. I've no idea why MS don't expose the version field properly - it's mad.Signac
Thanks @JulianKnight I agree, it is mad! We are about to upgrade to SP 2013 ... so I assume it is still the same there as well then.Booby
Yes, still the same sadly.Signac
I am not able to see the correct version after publishing the document to major version. Is there any work around available?Dasyure
Just to say that this IS working in March 2017 with Office 2016. It seems that the documents MUST have been saved after the label is set up however. The data is also available to Word VBA as ActiveDocument.ContentTypeProperties.Item("Label")Signac
A
13

This requires configuring both SharePoint and your Word document.


TO CONFIGURE SHAREPOINT'S DOCUMENT LIBRARY:

  1. Go to the document library where you plan to store your version-controlled documents.
  2. Click on Settings > Document Library Settings
  3. Click on "Versioning settings" and make sure that you're either having it "create major versions" or "create major and minor (draft) versions".
  4. Click OK.
  5. Click on "Information management policy settings"
  6. If your library can handle multiple content types, you'll see a list of them. Click on "Document". If it can only handle one content type, skip this step.
  7. Select "Define a policy..." and click OK.
  8. Check the "Enable Labels" box, but don't check either of the other two boxes in that section.
  9. Type {Version} into the "Label format" box.
  10. (Optional) You can format the version label.
  11. Click on the "Refresh" button to see a preview of your version label. It will say something like {_UIVersionString}
  12. When you're satisfied with the label's appearance, click OK.
  13. To get back to your document library, click on the document library's name in the breadcrumb trail at the top of the page.

TO CONFIGURE YOUR WORD DOCUMENT:

  1. Either create a new document in the library or upload one.
  2. Open the document and edit it.
  3. Put the cursor wherever you want the version label to appear.
  4. Go to Insert > Quick Parts > Document Property > Label
  5. The version label "{_UIVersionString}" will show up in the document.
  6. Save the document (and choose what the next version should be). You're all set!
  7. If you want to test it, close the document and reopen it. The updated version will automatically appear where you put the version label.

These instructions were based on Erwin's answer.

Amato answered 15/9, 2009 at 19:18 Comment(1)
Thanks for a slightly more clear outline of Erwin's instructions, but in the future you may consider using the "edit" button on his answer rather than submitting your own. Well done on giving credit though. :)Expect
H
2

I followed Rachel's instructions and they worked great. However, capturing this version update in the document does create a problem if you want to do electronic signatures. For instance, if your version is 1.6 and you decide this is the one for people to sign; you'll find that when they sign it, the document will be saved as version 1.7. When you open the document again, the version 1.7 will not match the authorized version of 1.6 and you'll be informed that all the signatures are invalid.

Hamburger answered 24/7, 2010 at 1:0 Comment(0)
P
2

IMPORTANT: In SP2010 you cannot save as a site template when Labels are enabled within a document library under Information management policy settings. The document library will get corrupted and even if we disable the policy, the save as site template function is still broken. The only option seems to be to permanently delete and rebuild the list.

Palmate answered 6/10, 2011 at 10:25 Comment(0)
A
1

The RevNum field that I think jaloplo is referring to is not the same as the SharePoint document version number. It updates every time you save the document, but seems to keep its own revision numbering system, correlated to (but independent of) the SharePoint version numbering system.

Amato answered 12/8, 2009 at 21:6 Comment(0)
W
0

Try creating a calculated field in a custom content type. The field can be equal to the Version. That will give you the ability to add it as a property in the document. This only works well with Office 2007 docs.

Once a custom content type is created, you create a new document based on the content type. After creating the document, you can extract the document information panel and save it. It is an info path form, so you can customise it if necessary and upload the customised panel to the content type.

Womankind answered 3/2, 2009 at 19:49 Comment(0)
F
0

Erwin's answer is spot on, but I wanted to leave this in case someone runs into the same issue I did. If you attempt to set the label for version on the site collection content type rather than at the document library level, you will get the error "The label reference, Version, could not be found." when previewing or saving the Information Policy. Also, you will be unable to save a policy at the document library level if you have previously defined one at the site collection content type level. It must be set to "None" on the site collection content type. Probably should have been obvious to me from the start, but it wasn't, and maybe this will help someone else down the line.

Fetching answered 17/4, 2011 at 3:27 Comment(0)
N
-2

All columns of a document library are document properties for a word document. To take the version of the document you have to show document properties and then select "advanced properties". In thit moment, you'll see the classic document properties window and you can see the "Version" property in the last tab.

So, you can add the value of this property to your document in the place you want, for example, the footer.

Noreen answered 5/2, 2009 at 22:9 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.