Insert text with image into a SharePoint LIstItem
I do the creation of items in SharePoint, with a WPF/C # app, as in the example:
using System;
using Microsoft.SharePoint.Client;
using SP = Microsoft.SharePoint.Client;
namespace Microsoft.SDK.SharePointServices.Samples
{
class CreateListItem
{
static void Main()
{
string siteUrl = "http://MyServer/sites/MySiteCollection";
ClientContext clientContext = new ClientContext(siteUrl);
SP.List oList = clientContext.Web.Lists.GetByTitle("Announcements");
ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();
ListItem oListItem = oList.AddItem(itemCreateInfo);
oListItem["Title"] = "My New Item!";
oListItem["Body"] = "Hello World!";
oListItem.Update();
clientContext.ExecuteQuery();
}
}
}
The issue is that in the "Body" column, I would have to insert a content coming from a RichTextBox, where it is possible to insert texts with images.
I have not found a way to insert the text and images, added As in a word document, to this column. Getting the RTB content with textRange results in converting the image to hexadecimal, which doesn't suit me.
I know that it may be necessary to save the images in a directory within sharepoint and reference them in the text, like an index or something, but I did not find documentation and I have no idea how to do.
2