I am converting Word Docx files each containing several Textboxes.
If I use wmltohtmconverter it ignores any textboxes.
If I parse the entire document.xml file it also ignores (or doesn’t see) the textboxes.
In VB: (the last two of the select case don’t have any effect. The first two work great in retrieving text and table contents.
Using wDoc As WordprocessingDocument = WordprocessingDocument.Open(filename, False)
Dim parts = wDoc.MainDocumentPart.Document.Descendants.FirstOrDefault()
If parts IsNot Nothing Then
For Each node In parts.ChildElements
Select Case True
Case TypeOf node Is Paragraph
ProcessParagraph(CType(node, Paragraph))
Case TypeOf node Is Table
ProcessTable(CType(node, Table))
Case TypeOf node Is DocumentFormat.OpenXml.OpenXmlCompositeElement
Debug.Print(“Textbox”)
Case TypeOf node Is DocumentFormat.OpenXml.Wordprocessing.TextBoxContent
ProcessTextBox(CType(node, DocumentFormat.OpenXml.Wordprocessing.TextBoxContent))
End Select
Next
End If
End Using