How to retrive the data of the Word Document using LibreOffice, c#

public List GetWord()
{
var elements = new List();
XEnumerationAccess xEnumerationAccess = (XEnumerationAccess)_textDocument.getText();
XEnumeration xEnumeration = xEnumerationAccess.createEnumeration();

 // Loop over all text elements
 while (xEnumeration.hasMoreElements())
 {
     object nextElement = xEnumeration.nextElement();
     XServiceInfo xServiceInfo = nextElement as XServiceInfo;
     if (xServiceInfo != null)
     {
         if (xServiceInfo.supportsService("com.sun.star.text.TextTable"))
         {
             elements.Add("Table: " + nextElement.ToString());
         }
         if (xServiceInfo.supportsService("com.sun.star.text.Paragraph"))
         {
             XTextRange xTextRange = nextElement as XTextRange;
             if (xTextRange != null)
             {
                 string paragraphText = xTextRange.getString();
                 elements.Add("Paragraph: " + paragraphText);
             }
         }
     }
 }
 return elements;

}

i am doing like this to get the text value of the document but i am unable to do it. can any one help me to get the text elements from the word document

coming from where ?

XComponent document = _componentLoader.loadComponentFromURL(fileUrl, “_blank”, 0, new PropertyValue[0]);
_textDocument = (XTextDocument)document;

i am doing like this inside a method, the fileUrl is passed with the help of parameter. the doucment is loaded perfectly. can you help to get the data of the word file

I recommend that you create an odt and implement the functionality in LO Basic, replacing the elements.add with a MsgBox. If it works there, post the odt, then I can help with translation to C#