Hi,
Im having problems setting text in RichText Content Controls, I cant get it to work.
I have a loop where i loop through all content controls in a document where i should set/change the text in that control. The code below works fine for planeText but not sure how to implement it for RichText, i can add a new richtext last in the document but its not really good enought for what im trying to achine, I really need to set the text in a specific CC RichText and not just add a new one… Anyone pls?
foreach (StructuredDocumentTag sdt in sdtNodes)
{
transText = GetText();
if (transText != "")
{
if (sdt.SdtType == SdtType.PlainText)
{
sdt.RemoveAllChildren();
Paragraph para = sdt.AppendChild(new Paragraph(doc)) as Paragraph;
Run run = new Run(doc, transText);
para.AppendChild(run);
}
else if (sdt.SdtType == SdtType.RichText)
{
// ``???
}
}
}
br Martin