How can we retrieve an older version of a document using .NET?
spFile = EventWeb.GetFile( _FileName );
if (spFile.Versions.Count > 1)
{
//restore previous version
spFile.Versions.Restore(spFile.Versions.Count - 1);
}
if (spFile.Versions.Count > 1)
{
//restore previous version
spFile.Versions.Restore(spFile.Versions.Count - 1);
}
Similarly, you can delete the document version:
spFile.Versions.Delete(spFile.Versions.Count - 1);
No comments:
Post a Comment