Take the 2-minute tour ×
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

1 Answer 1

Try using fileVersion.Properties["display_urn:schemas-microsoft-com:office:office#Editor"].

share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.