

xcDocument = GETFILE('*.*')

WordApp = CREATEOBJECT("word.application")
IF VARTYPE(WordApp)#"O"
	RETURN
ENDIF
WAIT WINDOW "Abriendo "+JUSTFNAME(xcDocument)+"..." AT 12,15 nowait
 

WordDoc = WordApp.Documents.Open(xcDocument)
WordDoc.Select
oWord=WordApp.ActiveDocument
 
oWord.SaveAs("\temp\file.txt", 2) &&WordDoc.wdFormatDOSText)

WAIT WINDOW "Cerrando Microsoft Word ®..." AT 12,15 nowait
WordDoc.Close()
WordDoc = null
WordApp.QUIT
WordApp = null

sFile = FILETOSTR("\temp\file.txt")

DIMENSION aa[1]
nRow = ALINES(aa,sFile)

FOR i= 1 TO nRow
	IF !EMPTY(aa[i])
		?STR(i)+' --> '+ aa[i]
	ENDIF
ENDFOR


