Here is my stab at the code from the information I found on various sites. My
survey name is "DSI Projects", my picture library is "Project Photos" and the
url where this lists are located is
http://sharepoint/dsi/itdept/intranet/itprojectsites/dsimarketing.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Sharepoint;
namespace Eventhandler_CreatePhotoFolder
{
public class AddPhotoFolder: SPItemEventReceiver
{
public override void ItemUpdated(SPItemEventProperties properties)
{
SPList survey =
properties.OpenWeb().GetList("http://sharepoint/dsi/itdept/internal/dsimarketing\
/Lists/DSI%20Projects");
SPFieldLookupValue surveyvalue =
(SPFieldLookupValue)ItemUpdated.fields["Project
Name"].GetFieldValue((string)ItemUpdated["Project Name"]);
SPItem projectname = survey.Items[surveyvalue.LookupID];
if (properties.ListItem["Completed"] != 1)
{
SPSite _MySite = new
SPSite("http://sharepoint/dsi/itdept/itprojectssite/dsimarketing/");
SPWeb _MyWeb = _MySite.OpenWeb();
SPDocumentLibrary _MyDocLibrary =
(SPDocumentLibrary)_MyWeb.Lists["Project Photos"];
SPFolderCollection _MyFolders = _MyWeb.Folders;
_MyFolders.Add("http://sharepoint/dsi/itdept/internal/itprojects
site/dsimarketing/Project%20Photos/" + projectname + "/");
_MyDocLibrary.Update();
}
}
}
}