Missing table in Range of Content Control (Structured Document Tag) when opening the Document with Word

Hi!

I am using Aspose to generate a document. When I save the document to a file then the content looks like this:

<w:body>
    <w:sdt>
        <w:sdtPr>
            <w:alias w:val="DOK" />
            <w:tag w:val="DOK_73a86c19-feb4-4927-aabb-263b3873fb2e" />
            <w:id w:val="1598891489" />
            <w:placeholder>
                <w:docPart w:val="DefaultPlaceholder_22675703" />
            </w:placeholder>
            <w:richText />
            <w15:color w:val="FF00FF" />
        </w:sdtPr>
        <w:sdtContent>
            <w:sdt>
                <w:sdtPr>
                    <w:alias w:val="LBB" />
                    <w:tag w:val="LBB_b4d23fea-998a-45cf-9ba0-e082dc4e3997" />
                    <w:id w:val="1589318177" />
                    <w:placeholder>
                        <w:docPart w:val="784AE2EB80E845AAAEDC4A99F5FFF668" />
                    </w:placeholder>
                    <w:richText />
                    <w15:color w:val="FF00FF" />
                    <w15:appearance w15:val="tags" />
                </w:sdtPr>
                <w:sdtContent>
                    <w:sdt>
                        <w:sdtPr>
                            <w:alias w:val="TXT" />
                            <w:tag w:val="TXT_da35e7c9-7cc0-4d2d-97da-d4261ed04cdc" />
                            <w:id w:val="989651155" />
                            <w:placeholder>
                                <w:docPart w:val="DA9659049FF041CE800E9F94B4E6C614" />
                            </w:placeholder>
                            <w:richText />
                            <w15:color w:val="FF00FF" />
                            <w15:appearance w15:val="tags" />
                        </w:sdtPr>
                        <w:sdtContent>
                            <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                            </w:p>
                            <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                            </w:p>
                            <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                            </w:p>
                            <w:tbl>
                                <w:tblPr>
                                    <w:tblStyle w:val="TableNormal" />
                                    <w:tblW w:w="0" w:type="auto" />
                                    <w:tblLayout w:type="fixed" />
                                    <w:tblCellMar>
                                        <w:left w:w="70" w:type="dxa" />
                                        <w:right w:w="70" w:type="dxa" />
                                    </w:tblCellMar>
                                    <w:tblLook w:val="0000" />
                                </w:tblPr>
                                <w:tblGrid>
                                    <w:gridCol w:w="1560" />
                                    <w:gridCol w:w="1701" />
                                </w:tblGrid>
                                <w:tr w:rsidTr="005468F2">
                                    <w:tblPrEx>
                                        <w:tblW w:w="0" w:type="auto" />
                                        <w:tblLayout w:type="fixed" />
                                        <w:tblCellMar>
                                            <w:left w:w="70" w:type="dxa" />
                                            <w:right w:w="70" w:type="dxa" />
                                        </w:tblCellMar>
                                        <w:tblLook w:val="0000" />
                                    </w:tblPrEx>
                                    <w:tc>
                                        <w:tcPr>
                                            <w:tcW w:w="1560" w:type="dxa" />
                                        </w:tcPr>
                                        <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                            <w:pPr>
                                                <w:pStyle w:val="SVSNormal" />
                                            </w:pPr>
                                            <w:r>
                                                <w:t>Futter</w:t>
                                            </w:r>
                                        </w:p>
                                    </w:tc>
                                    <w:sdt>
                                        <w:sdtPr>
                                            <w:alias w:val="OBR" />
                                            <w:tag w:val="OBR_de17ab9f-1b49-4b5a-b801-e75ed495155f" />
                                            <w:id w:val="618021908" />
                                            <w:placeholder>
                                                <w:docPart w:val="DefaultPlaceholder_22675703" />
                                            </w:placeholder>
                                            <w:richText />
                                        </w:sdtPr>
                                        <w:sdtContent>
                                            <w:sdt>
                                                <w:sdtPr>
                                                    <w:alias w:val="OFR" />
                                                    <w:tag w:val="OFR_915efbf3-320b-4518-885b-d6c9aed2fd80" />
                                                    <w:id w:val="1255991728" />
                                                    <w:placeholder>
                                                        <w:docPart w:val="1E3D44E7C05A4E809C1BD7E86E3CF535" />
                                                    </w:placeholder>
                                                    <w:richText />
                                                    <w15:color w:val="FF00FF" />
                                                    <w15:appearance w15:val="tags" />
                                                </w:sdtPr>
                                                <w:sdtContent>
                                                    <w:tc>
                                                        <w:tcPr>
                                                            <w:tcW w:w="1701" w:type="dxa" />
                                                        </w:tcPr>
                                                        <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                                            <w:pPr>
                                                                <w:pStyle w:val="SVSNormal" />
                                                            </w:pPr>
                                                            <w:r>
                                                                <w:t xml:space="preserve"></w:t>
                                                            </w:r>
                                                        </w:p>
                                                    </w:tc>
                                                </w:sdtContent>
                                            </w:sdt>
                                        </w:sdtContent>
                                    </w:sdt>
                                </w:tr>
                            </w:tbl>
                            <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                            </w:p>
                            <w:p w:rsidR="005468F2" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                                <w:bookmarkStart w:id="0" w:name="_GoBack" w:displacedByCustomXml="next" />
                                <w:bookmarkEnd w:id="0" w:displacedByCustomXml="next" />
                            </w:p>
                            <w:p w:rsidR="0053462B" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                                <w:r>
                                    <w:t>Das ist ein fixer Text!</w:t>
                                </w:r>
                            </w:p>
                            <w:p w:rsidR="0053462B" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                            </w:p>
                            <w:p w:rsidR="00D669C6" w:rsidP="0027746B">
                                <w:pPr>
                                    <w:pStyle w:val="SVSNormal" />
                                </w:pPr>
                            </w:p>
                        </w:sdtContent>
                    </w:sdt>
                </w:sdtContent>
            </w:sdt>
        </w:sdtContent>
    </w:sdt>
    <w:sdt>
        <w:sdtPr>
            <w:alias w:val="BFL" />
            <w:tag w:val="BFL_20887bcf-223b-4329-a6eb-ce1c509f59ba" />
            <w:id w:val="1325612735" />
            <w:placeholder>
                <w:docPart w:val="DefaultPlaceholder_22675703" />
            </w:placeholder>
            <w:richText />
            <w15:color w:val="FF00FF" />
        </w:sdtPr>
        <w:sdtContent>
            <w:p w:rsidR="00577F19">
                <w:pPr>
                    <w:rPr>
                        <w:vanish />
                    </w:rPr>
                </w:pPr>
            </w:p>
            <w:sdt>
                <w:sdtPr>
                    <w:alias w:val="BF" />
                    <w:tag w:val="BF_a4138eb2-4c5b-42ea-9c48-848aaefc8755" />
                    <w:id w:val="2028858253" />
                    <w:placeholder>
                        <w:docPart w:val="8B1EF44BB6C14DCABAC13C6B4EA5B871" />
                    </w:placeholder>
                    <w:richText />
                    <w15:color w:val="FF00FF" />
                    <w15:appearance w15:val="tags" />
                </w:sdtPr>
                <w:sdtContent>
                    <w:p>
                        <w:pPr>
                            <w:rPr>
                                <w:vanish />
                            </w:rPr>
                        </w:pPr>
                    </w:p>
                </w:sdtContent>
            </w:sdt>
        </w:sdtContent>
    </w:sdt>    
</w:body>

The interesing part here is that I have a table with row and cells. The structured document tag “OBR” is nested to the row. “OFR” is nested to “OBR”. So far so good.

Then I open this file with Microsoft Word. An C# Add-In for VSTO is loaded which can manipulate the document (injected as Microsoft.Office.Interop.Word.Document). But then during debugging I noticed that the range of the “OBR” content control shows me that:

<w:body>
		<w:sdt>
			<w:sdtPr>
				<w:alias w:val="OFR" />
				<w:tag w:val="OFR_22bcfd06-7208-4e35-b9fe-4aa8012ec26c" />
				<w:id w:val="1968233566" />
				<w:placeholder>
					<w:docPart w:val="0DDEB0B48C2346179C8C4D3051A039A3" />
				</w:placeholder>
				<w:richText />
				<w15:color w:val="FF00FF" />
				<w15:appearance w15:val="hidden" />
			</w:sdtPr>
			<w:sdtContent>
				<w:p w:rsidR="00000000">
					<w:r>
						<w:t xml:space="preserve"> </w:t>
					</w:r>
				</w:p>
			</w:sdtContent>
		</w:sdt>
		<w:sectPr>
			<w:pgSz w:w="12240" w:h="15840" />
			<w:pgMar w:top="1417" w:right="1417" w:bottom="1134" w:left="1417" w:header="720" w:footer="720" w:gutter="0" />
			<w:cols w:space="720" />
		</w:sectPr>
	</w:body>

The strange for me is what happend with the table and the row? I would have expected something like that:

<body>
    <table>
        <row>
            <ofr>
                <cell>
                </cell>
            </ofr>
        </row>
    </table>
</body>    

Why is it directly nested beneath the body?

@pulla2908

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the expected output Word file that shows the desired behavior.
  • Please create a standalone console application (source code without compilation errors) that helps us to reproduce your problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we will start investigation into your issue and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip and upload them.