Loop/Iterate through a MS Word document

Hi

I want to achieve following in AX 2009.

Input .doc/.docx file

while(endOfFile)

{

getWord;

// for this particular WORD do something; if certain condition is met.

nextWord;

}

I have started from following reference.

learnax.blogspot.it/…/x-code-to-read-ms-office-word-document.html.

There is a lot of help available for VBA and C#, but I am unable to implement using it X++.