Public static void readword2003 (string filename) {inputstream = NULL; wordextractor = NULL; string word = NULL; try {inputstream = new fileinputstream (filename); wordextractor = new wordextractor (inputstream); word = wordextractor. gettext ();} catch (filenotfoundexception e) {e. printstacktrace ();} catch (ioexception e) {e. printstacktrace ();} Finally {If (null! = Inputstream) {try {inputstream. close ();} catch (ioexception e) {e. printstacktrace () ;}} system. out. println (Word);} public static void readword2007 (string filename) {opcpackage = NULL; xwpfwordextractor = NULL; string word = NULL; try {opcpackage = poixmldocument. openpackage (filename); xwpfwordextractor = new xwpfwordextractor (opcpackage); word = xwpfwordextractor. gettext ();} catch (ioexception e) {e. printstacktrace ();} catch (xmlexception e) {e. printstacktrace ();} catch (openxml4jexception e) {e. printstacktrace ();} system. out. println (Word) ;}