A very nice article by Anita about getting document versions:
And the result:
http://www.itidea.nl/index.php/documents-and-versioning
SPDocumentLibrary sharedDocs = SPContext.Current.Web.Lists[ 'Shared Documents' ] as SPDocumentLibrary; |
resultBox.Text = string .Empty; |
foreach (SPListItem doc in sharedDocs.Items) |
{ |
SPListItemVersionCollection coll = doc.Versions; |
resultBox.Text += 'Versions of ' + doc.Name + Environment.NewLine; |
foreach (SPListItemVersion version in coll) |
{ |
resultBox.Text += 'VersionLabel: ' + version.VersionLabel + ' IsCurrentVersion: ' + version.IsCurrentVersion + Environment.NewLine; |
} |
} |
And the result:
http://www.itidea.nl/index.php/documents-and-versioning
No comments:
Post a Comment