using (SPSite site = new SPSite("siteAddress"))
{
using (SPWeb web = site.OpenWeb("webAddress"))
{
SPListItem listItem = web.Lists["Project Documents"].GetItemById(_id);
try
{
listItem.File.CheckIn("Checked in by force");
listItem.Update();
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
Console.ReadKey();
}
}
}
No comments:
Post a Comment