Plain and simply, I have a c:\dropdowntest.docx file that has nothing but one single dropdown list. The dropdown list has two options, "Option1" and "Option2". The file is saved so that "Option1" is selected. How do I select the "Option2" by using the Open XML SDK in C#?
Here's a start for the code, so I'm for example able to refer to the dropdown list:
privatestaticvoidLoopElements(WordprocessingDocument wordDocument){List<SdtElement> sdtelements = wordDocument.MainDocumentPart.Document.Descendants<SdtElement>().ToList();foreach(var contentcontrol in sdtelements){var listitems = contentcontrol.Descendants<ListItem>().ToList();if(listitems.Count>0){SdtRun xStdRun =(SdtRun)contentcontrol;