SharePoint check in SPListItem

Rupert picture Rupert · Sep 1, 2009 · Viewed 14.3k times · Source

In sharepoint how can you check in an SPListItem?

Answer

Alex Angas picture Alex Angas · Sep 1, 2009

See on MSDN: SPListItem.File.CheckIn();

For example:

SPFile file = item.File;
if (file.CheckOutStatus != SPFile.SPCheckOutStatus.None)
{
    file.CheckIn("Reason for check in.", SPCheckinType.MajorCheckIn);
}

The optional second parameter allows specification of either minor, major or overwrite check in via the SPCheckinType enumeration.