This article discusses the fact that the slide content type is unavailable in standard enumeration in Microsoft Office SharePoint Server 2007.
In SharePoint Server 2007, the slide library event handler runs only in the context of the slide library. Therefore, the slide content type is not available outside the slide library context. The usage of the slide content type in custom code is not supported.
The following code enumerates through content types that are available at a site collection level. This code does not return the slide content type.
string strResult = string.Empty;
TextBox tbResult = null;
SPSite site = null;
SPWeb web = null;
try
{
site = new SPSite("http://<sitecollectionurl>");
web = site.OpenWeb();
SPContentTypeCollection contentTypes = web.ContentTypes;
foreach (SPContentType contentType in contentTypes)
{
strResult += "Content Type Name: " + contentType.Name + System.Environment.NewLine;
}
tbResult.Text = strResult;
}
catch (Exception _e)
{
MessageBox.Show("Error: " + _e.Message + System.Environment.NewLine +
"Stack Trace: " + _e.StackTrace);
}
finally
{
if (web != null)
web.Close();
if (site != null)
site.Close();
}