Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Retrieving Past Document Version Check In Comments

  Asked By: Dora    Date: Aug 01    Category: Sharepoint    Views: 1946

I am trying to create a custom workflow in VS 2008 for a document
library which will retrieve and summarize all previous minor version
check in comments for a given document. This bulleted list of
changes will subsequently be emailed to a select list of users who
are interested in major version document changes.

Here is the list of versions and their comments as visible from the
SP Version History screen for a single test document:

Ver Modified Modified by Size Comments
2.0 2/25/2009 2:45 PM John Doe 16.2 KB Another big change.
1.1 2/25/2009 2:41 PM John Doe 16.1 KB Minor change
1.0 2/25/2009 2:38 PM John Doe 16.1 KB Did lots!
0.2 2/25/2009 10:23 AM John Doe 16.1 KB Version #2
0.1 2/25/2009 10:23 AM John Doe 16 KB Version # 1

So I wrote a little bit of code in my workflow to retrieve the
comments associated with each version:

private void codeActivity1Exec(object sender, EventArgs e)
foreach (SPListItemVersion ver in
System.Diagnostics.Debug.Print(ver.VersionLabel +
" - [" + ver.Fields["Check In
Comment"].GetFieldValueAsText(ver["Check In Comment"]) + "]");

Surprisingly, here is its output:

2.0 - [Another big change.]
1.1 - [Another big change.]
1.0 - [Another big change.]
0.2 - [Another big change.]
0.1 - [Another big change.]

It seems the API is only giving me the most recent Check In Comment
despite the version label being different. Can anyone help me figure
what I'm doing wrong?



No Answers Found. Be the First, To Post Answer.

Didn't find what you were looking for? Find more on Retrieving Past Document Version Check In Comments Or get search suggestion and latest updates.