Last week I got an interesting request from a customer: They would like to be able to see what a document library looked like at a given date. As far as I know this will require that the library 1) uses versioning, and 2) no limit to the number of versions

A brute force approach would be to iterate each item in the SPDocumentLibrary and check the created date of the SPListItemVersion but that is far from an elegant solution.

Is there a better way to identify the documents that existed at that date and return the current version at that date?

  • I'll try out a scaled down approach: then the user needs to create a new baseline I'll just copy the most recent version of each file to a new folder(named by datetime) and then remove all rights but read rights. – Kasper Bo Larsen Nov 28 '09 at 16:36
up vote 1 down vote accepted

Interesting request. If we continue the Time Machine analogy, do they just want to be able to 'see' what documents where there at that point in time or be able to open a document from that moment in time (would require lots of BLOB duplications)?

You could attach a Workflow to the Library that every time a CRUD event fires, it writes the metadata to a history tracking List so they could see what items where there at that moment with anything you were tracking. Pretty quick and easy way to do this, as I had to do it once for a customer.

  • They want to be able the docs as they were at that moment in time. I might be able to change the requirement to be something like: "When a user checkes of a "create document base line" checkbox, all documents in that library will be copied to a hidden document library, each document tagged with the guid of the library and the datetime stamp". Does this sound like a better solution? – Kasper Bo Larsen Nov 12 '09 at 23:00
  • That sounds like a good idea to make it optional. I'd just hate to have your users always mark the baseline option since SharePoint doesn't do a diff of the files, instead copying the BLOB back into the database so you would have lots of full copies of the docs. – Craig Pilkenton Nov 16 '09 at 20:53

You could use the Lists Web Service to get at the versions using a Data View Web Part. Regardless, it'll be a bit of a logic challenge, as you allude to. I'm interested in what the use case sounds like on this one. Easy to ask for, perhaps hard to develop, but to what actual use?


  • They probably saw the Mac Time Machine app and decided that's what they want for SharePoint. Silverlight? ;-) – Alex Angas Nov 9 '09 at 20:46
  • Well, if you are familiar with "blame" in subversion you'll get the picture. The site is a project management system and in case of scope creep the project manager will be able to prove his case by comparing the base line with the current version. – Kasper Bo Larsen Nov 9 '09 at 22:16

Your Answer


By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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