I have a sharepoint document library containing documents and folders (the folders are newly introduced as a new content type derived from folder) and I'm having an event reciever on document added only to my folders. So to recover the parent folder of my newly added document I tried to write this way but it doesn't seem to work well :
public override void ItemAdded(SPItemEventProperties properties) { base.ItemAdded(properties); //getting the item (document) newly added to my content type folder SPListItem myItem = properties.ListItem; //getting the folder containing my doc SPFolder myFolder = myItem.File.ParentFolder; //other code on my SPFolder }