I have an SPListEventReceiver that handles the ListAdded event. If checks that the list is a Document Library, and then adds some fields to the library:

```
public class ListEventReceiver : SPListEventReceiver
{
    public override void ListAdded(SPListEventProperties properties)
    {
        if (properties.List.BaseTemplate == SPListTemplateType.DocumentLibrary)
        {
            // Add fields here
        }
        base.ListAdded(properties);
    }
}

```

When a list is created using SharePoint's web UI, the event works perfectly.
However, when the list is created by the code below, the event is not fired, and the fields are not added:

```
SPWeb spWeb = ...;
SPListTemplate listTemplate = ...; //Find relevant DocLib template
Guid newListId = spWeb.Lists.Add(title, description, listTemplate);

```

**EDIT: I do not have the option of changing the EventReceiver - it was created by a third party, and I have no control over it.**