2
I create 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 point is that in the "Body" column, I would have to insert a content coming from a Richtextbox, where it is possible to insert text with images.
I couldn’t find a way to insert the text and images, added as in a word document, into that column. Getting the RTB content with textRange results in converting the image to hexadecimal, which does not suit me.
I know that it may be necessary to save the images in a directory inside Sharepoint and refer them to the text, as an index or something, but I did not find documentation and I have no idea how to do.
Your problem is in defining Listitem as Richtext or reading and converting the word document?
– Leandro Angelo
My problem is in converting the contents of a Richtextbox, which is in my application, to the column of Listitem of SP. If it were only text, it would be quiet, as in the example. But since Richtextbox in my application can contain images next to the text, I don’t know how to enter this data.
– SUR1C4T3
What type of text does Sharepoint accept ? could send html ?
– Rovann Linhalis
It accepts html, however, if sending an html I would have to identify the images in the middle of the text, upload them to a folder within Sharepoint, so it is possible to refer them to the html content
– SUR1C4T3