Wednesday, May 2, 2012

Rich Text to Plain Text in SharePoint Client Side Object Model

It took me a while to figure out how to do this, so I thought it would be worthwhile to document it on the Internet as no matter how I searched I could not find a good solution. Basically I have a SharePoint field of type FieldMultiLineText (or SPFieldMultiLineText on the server object model). In the server object model there is the GetFieldValueAsText() method. But there was no such method in the CSOM. In the CSOM it is used like this:

string myString = item.FieldMultiLineText[Field_Name]

Simple enough!