Tell me more ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am writing a tool to generate the versions of a file/page in the library. My Report should include the version number and the version created by/Modified by name.

While getting the modified by column for the version through code it is giving a username which is not same on the sharepoint UI.

This is the code im using to get the modified by value of a version


SPFolder folder = file.ParentFolder; SPFileVersionCollection fileVersions = file.Versions; if (fileVersions.Count > 0) { foreach (SPFileVersion fileVersion in fileVersions) { if (fileVersion.Properties["vti_modifiedby"] != null) { string author = Convert.ToString(fileVersion.Properties["vti_modifiedby"]); Console.WriteLine("file version" + fileVersion.VersionLabel + " Author " + author); }

                    }
                }

Any Idea ?

share|improve this question

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.