No File Check In requirement when uploading new file?

Our site is configured to require a check out before editing any document. We often upload many documents at once, which requires us to checkin each document before others can access. We are able to check in all the documents at once after an upload if we use site settings, content and structure. But this can be confusing to the end user.

Can we require a checkout and checkin for all edits on existing documents, but also configure so that any document uploaded will not require a check in?

thank you 

Steve

September 14th, 2015 4:54pm

Hi Steve,

As your description, you want to make files automatically checked-in after uploading to SharePoint.

You can create an Event Receiver to do it.

using System;
using System.Security.Permissions;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Security;
using Microsoft.SharePoint.Utilities;
using Microsoft.SharePoint.Workflow;

namespace CustomItemAdded.EventReceiver1
{
    public class EventReceiver1 : SPItemEventReceiver
    {
       public override void ItemAdded(SPItemEventProperties properties)
       {
           base.ItemAdded(properties);
           SPFile thisFile = properties.ListItem.File;

           if (!thisFile.CheckOutType.Equals(SPFile.SPCheckOutType.None))
           {
               thisFile.CheckIn("Checked in by custom event handler.");
           }
       }
    }
}

More information:

http://fahadismy.name/check-in-documents-automatically-after-uploading-to-sharepoint/

Best Regards,

Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 11:54pm