Sample Code:
Document d = new Document();
d.FolderId = ’00l90000001KHtg’; //Id of the folder under Documents
d.Name = e.Name + Date.Today();
d.ContentType = ‘text/plain’;
d.Body = Blob.valueOf(e.Name + ‘ ‘ + e.State__c);
insert d;
Cheers!!!