从excel中读取embedded式MSWord文件并将其保存到使用Java的驱动器中

我有两个Ms Word文件embedded在其中的Excel文件。 我正在使用Apache POI从Java中的Excel文件读取embedded对象。 问题是当我读取embedded式文件并将其保存在磁盘上并打开MS Word中保存的文件时,MS Word无法读取其格式。 如果直接从excel文件打开它打开,Ms Word正确读取它。 任何人都帮助我。 [码]

public class test { public static void main(String[] args) throws Exception { File file = new File("C:/Book2.xls"); NPOIFSFileSystem fs = new NPOIFSFileSystem(file); HSSFWorkbook wb = new HSSFWorkbook(fs.getRoot(), true); for (HSSFObjectData obj : wb.getAllEmbeddedObjects()) { String oleName = obj.getOLE2ClassName(); DirectoryNode dn = (DirectoryNode)obj.getDirectory(); Iterator<Entry> ab = dn.getEntries(); if(oleName.contains("Document")){ HWPFDocument embeddedWordDocument = new HWPFDocument(dn); String docTitle = embeddedWordDocument.getSummaryInformation().getTitle(); InputStream is ; Entry entry = ab.next(); is = dn.createDocumentInputStream(entry); FileOutputStream fos = new FileOutputStream("d:/"+docTitle+".doc"); System.out.println(is.available()); System.out.println(((DocumentEntry)entry).getSize()); IOUtils.copy(is, fos); fos.close(); is.close(); } } fs.close(); } }