How do I rename the document in the document library without changing the modifed by and no increment of version?
My Document Library setting is Major Version and CheckOut is set to No.
I'm using SPSecurity.RunWithElevatedPrivileges to rename the document
I had tested to checkout then checkin but there is an increment in version.
Here is a sample code that will rename the filename but the modified by changed to System Account.
using (SPSite elevatedSite = new SPSite(SPContext.Current.Site.ID))
using (SPWeb elevatedWeb = elevatedSite.OpenWeb(SPContext.Current.Site.RootWeb.ID))
elevatedWeb.AllowUnsafeUpdates = true;
SPList list = elevatedWeb.Lists["Library1"];
SPListItem item = list.GetItemById(documentID);
item["Name"] = filename;
Is there anyone out there who can help?
Thanks in advanced.
View Complete Post