![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
using (SPSite site = new SPSite("http://i-siteurl/"))
{
SPWeb web = site.RootWeb;
web.AllowUnsafeUpdates = true;
SPList list = web.Lists["order"];
try
{
list.Fields.Add("Name", SPFieldType.Note, true);
SPFieldMultiLineText text = new SPFieldMultiLineText(list.Fields, "Name");
text.RichText = true;
text.RichTextMode = SPRichTextMode.FullHtml;
text.Update();
list.Fields["Name"].Update();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
不过这边需要注意的是,比如你想把一个单文本的转换为一个多文本的增强型,得现把SPFieldType从Text转到Note,再做处理