Getting content controls withing A Word Document Table

Hi,

I have written some code to load a Word document and recursively get a reference to every InlineContentControl and BlockContentControl.
For the most part this works. I have some business logic that then fills in the content control's text.

The problem I have is when there is a table. In this example, it is a single row table with two columns. Each cell has a content control within it. My code is able to get a reference to first content control but it cannot find the second content control.

-----------------------------------------------------------
|   (Content Control 1)   |   (Content Control 2 )   |
-----------------------------------------------------------

I have uploaded a sample project that contains my algorithm to get all content controls along the sample Word document.
How can I modify my code to ensure that I get a reference to every content control in the document?

Attachment: GetAllContentControls_c5994278.zip

1 Reply

DB Dilli Babu Nandha Gopal Syncfusion Team October 29, 2018 10:04 AM UTC

Hi Ariel, 

Thank you for contacting Syncfusion support. 

On analyzing further with the given Word document, we have found that the first cell has BlockContentControl and second cell has CellContentControl. Currently, Essential DocIO doesn’t have support for processing (add, remove, find, etc.) CellContentControl and so the second cell content control was not found in your algorithm. We have already considered this requirement as feature and we will implement this feature in any of our upcoming releases. We will let you know once this feature is implemented. 

So, we recommend to use BlockContentControl instead of CellContentControll in your input Word document. 

Regards, 
Dilli babu. 


Loader.
Up arrow icon