How do I track versioning in code?

Is there a way to programmatically capture and keep track of the version of a document in a library, and also track minor and major versions? I have never had to do this before and I have not seen any blog/post to point me in that right direction. Has anyone had any luck doing this before, or have an idea of something I can take a look at to get this done?

I really appreciate the help.

January 24th, 2014 11:53am

http://msdn.microsoft.com/en-us/library/Microsoft.SharePoint.SPFile_properties.aspx

There is a "versions" property on the SPFile object of the SPListItem...

I would start there.

Free Windows Admin Tool Kit Click here and download it now
January 24th, 2014 11:58am

You can check below link

Using CSOM.

http://www.captechconsulting.com/blog/amarender-peddamalku/sharepoint-2010-retrieve-document-library-version-history-using-client

Use Versions.asmx web service 

http://msdn.microsoft.com/en-us/library/versions.versions.getversions(v=office.12).aspx

other option is use powershell shell script and call that from your C# code

http://social.msdn.microsoft.com/Forums/en-US/7649f8f8-21b3-4187-a5a7-56974dc538be/how-to-get-list-of-all-documents-from-sharepoint-which-includes-version-history?forum=sharepointdevelopmentprevious

January 25th, 2014 12:02am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics