Manipulating Content Types Using the Object Model

Is really simple! Here is a small sample where I extend the content type ”Document” by adding the field ”Office”. Not really useful but shows how it’s done.   SPSite site = new SPSite(”http://moss.litwareinc.com”); SPWeb web = site.OpenWeb(”/SiteDirectory/t2”); //Create Content Type (extending Document content type) SPContentType documentContentType = web.AvailableContentTypes[”Document”]; SPContentType newContentType = new SPContentType(documentContentType, web.ContentTypes, […]