Getting All Content Controls using OpenXML
If you’re trying to get all of the content controls in an OpenXML document, the most obvious way to do it would be:
1 2 3 4 5 |
// Get the document instance WordprocessingDocument document = ...; // Get all of the SdtBlock elements document.MainDocumentPart.Document.Descendants<SdtBlock>(); |
But this will only get you some of the content controls. Basically, it won’t return any...