That's why we need to run the function below to formatting the string before assigning it to a "Note" field.
public static string FormattingForNote(string strBody)
{
string strReturn = string.Empty;
strReturn = strBody.Trim();
if (strReturn.IndexOf(Environment.NewLine) > 0)
{
strReturn = strReturn.Replace(Environment.NewLine, @"</div><div>");
strReturn = @"<div>" + strReturn + @"</div>";
}
return strReturn;
}
Update (20/04/2011): the full version source code is available at CodePlex as workflow activity enableNewLineForRichText.wsp
Thanks Eric.
ReplyDeleteIt works for me.
Thanks to share this with us.
-Kaustubh