Hi,
Hi Joe,
We are working on this issue and will update you soon.
Best Regards,
Hi Joe,
The control used in your document is neither a content control nor a form field. It is a ActiveX control which is not supported by Aspose.Words at the moment. A new feature request to support ActiveX has already been logged into our issue tracking system as WORDSNET-1877. We will keep you updated on this issue in this thread.
Currently ActiveX controls can be read as a Shape. so you need to replace StructuredDocumentTag with a Shape in your code.
If you want to use content controls, you can use the following code.
var doc = new Document("Sample.docx");
<?xml:namespace prefix = "o" ns = "urn:schemas-microsoft-com:office:office" />
foreach (StructuredDocumentTag sdt in doc.GetChildNodes(NodeType.StructuredDocumentTag, true, true))
{
if (sdt.SdtType == SdtType.DropDownList)
{
SdtListItem secondItem = sdt.ListItems[2];
sdt.ListItems.SelectedValue = secondItem;
Console.WriteLine(sdt.ListItems.SelectedValue.Value);
}
else if (sdt.SdtType == SdtType.ComboBox)
{
SdtListItem secondItem = sdt.ListItems[1];
sdt.ListItems.SelectedValue = secondItem;
Console.WriteLine(sdt.ListItems.SelectedValue.Value);
}
}
doc.Save(“AsposeOut.Docx”);
Best Regards,
The issues you have found earlier (filed as WORDSNET-1877) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(6)