We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Dropdownlist content control inside table cell using document builder c#

I am trying to add a content control , a dropdownlist,inside a table cell .How do i achieve that in c#.net using documentbuilder?

Anu Cherian

Hi Anu,

Thanks for your inquiry. You can move cursor inside Cell and use the following code to insert an SDT (StructuredDocumentTag or Content Control):

Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
StructuredDocumentTag sdt = new StructuredDocumentTag(doc, SdtType.DropDownList, MarkupLevel.Inline);
sdt.ListItems.Add(new SdtListItem("Aspose.Words", "1"));
sdt.ListItems.Add(new SdtListItem("Aspose.Cells", "2"));
sdt.ListItems.Add(new SdtListItem("Aspose.Pdf", "3"));
// doc.FirstSection.Body.FirstParagraph.AppendChild(sdt);
doc.Save(MyDir + @"17.3.0.docx");

Hope, this helps.

Best regards,

Hi Hafeez…

Great. Its working.

Anu Cherian