Código:
ahora estoy buscando una funcion que me permita manejar tablas d word en vb.net, si alguien tiene alguna idea c lo agradecere Private Function docToXml(ByVal doc As Word.Document) As XmlDocument Dim xmlDoc As New XmlDocument Dim styleMapper As New StyleMapping(Application.StartupPath & "\stylemapping.xml") 'Dim styleMapper As New StyleMapping("c:\stylemapping.xml") 'styleMapper.SetMapping("Normal", "text") xmlDoc.PreserveWhitespace = True Dim pageNode As XmlElement Dim tableNode As XmlElement Dim documentNode As XmlElement ' create a root document node documentNode = xmlDoc.CreateElement("document") xmlDoc.AppendChild(documentNode) ' add one page pageNode = Me.addPage(xmlDoc) documentNode.AppendChild(pageNode) Dim currentPageNumber As Integer = Integer.Parse(pageNode.Attributes("id").Value) ' loop through each paragraph For Each section As Word.Section In doc.Sections For Each p As Word.Paragraph In doc.Paragraphs ' check the pagenumber If CType(wordApp.Selection.Information(Word.WdInformation.wdActiveEndPageNumber), Integer) > currentPageNumber Then pageNode = Me.addPage(xmlDoc) currentPageNumber = Integer.Parse(pageNode.Attributes("id").Value) End If ' get the para text Dim s As String = p.Range.Text ' check to see if there's a hard page break at the start of this para If Asc(s.Chars(0)) = &HC Then s = s.Substring(1, s.Length - 1) pageNode = Me.addPage(xmlDoc) currentPageNumber = Integer.Parse(pageNode.Attributes("id").Value) End If If p.Range.Text.Trim <> String.Empty Then ' strip carriage return from end of para text Do While s.EndsWith(Chr(13)) Or s.EndsWith(Chr(10)) s = s.Substring(0, s.Length - 1) Loop Dim stylename As String = CType(p.Style, Word.Style).NameLocal Dim elementName As String = styleMapper.GetStyleToElementMapping(stylename) Dim N As XmlElement = xmlDoc.CreateElement(elementName) N.InnerText = s pageNode.AppendChild(N) ' If stylename = "<table>" Then ' tableNode = Me.addTable(xmlDoc) ' End If End If Next Next Return xmlDoc End Function