Quantcast
Channel: Open XML Format SDK forum
Viewing all articles
Browse latest Browse all 1288

How to loop through a word document and check whether the element is of type paragraph or SdtBlock in openXml

$
0
0

Hi ,

I want to loop through the word document and check what type of element it is and below is my code .

 foreach(var childElement in wordProcessingDocument.MainDocumentPart.Document.Body.Elements().ToList())
                {

                   if (childElement is DocumentFormat.OpenXml.Wordprocessing.SdtBlock )
                    {

                      //do something 

                     }

               }

But it never comes  to the loop even childElement  type is SdtBlock 

Any suggestion ?

Thanks 


Viewing all articles
Browse latest Browse all 1288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>