﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>DFW SharePoint User Group / SharePoint Users Group / Development  / Change Content Type using OM / Latest Posts</title><generator>InstantForum.NET v4.1.3</generator><description>DFW SharePoint User Group</description><link>http://www.dfwsharepoint.com/forum/</link><webMaster>skocurek@isi85.com</webMaster><lastBuildDate>Mon, 05 Jan 2009 23:48:06 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Change Content Type using OM</title><link>http://www.dfwsharepoint.com/forum/Topic90-4-1.aspx</link><description>Assuming you have an SPList object named 'list', an SPFolder object named 'folder' and an SPFile object named 'file', try the following code:&lt;/P&gt;&lt;FONT size=2&gt;&lt;P&gt;&lt;EM&gt;SPContentType type = list.ContentTypes[&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT color=#a31515 size=2&gt;&lt;EM&gt;"[Enter Content Type ID]"&lt;/EM&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;EM&gt;];&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;file.Item.ContentType = type;&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;folder.Files.Add(file);&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;folder.Update();&lt;BR&gt;&lt;/EM&gt;&lt;EM&gt;list.Update();&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT size=2&gt;&lt;EM&gt;&lt;/EM&gt; &lt;/P&gt;&lt;/FONT&gt;</description><pubDate>Tue, 21 Aug 2007 17:21:02 GMT</pubDate><dc:creator>eshupps</dc:creator></item><item><title>Change Content Type using OM</title><link>http://www.dfwsharepoint.com/forum/Topic90-4-1.aspx</link><description>Anybody knows how to change the Content Type of a document using the OM?</description><pubDate>Fri, 10 Aug 2007 12:43:46 GMT</pubDate><dc:creator>pierrebo6</dc:creator></item></channel></rss>