poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hofmann, Lysann" <Lysann.Hofm...@geosn.sachsen.de>
Subject HWPF Replace doesn´t works
Date Wed, 17 Aug 2011 11:46:35 GMT
Hello
I have a problem.
 I want Words   in a . doc .replace with following Code:

  HWPFDocument doc;
				try {
					doc = new HWPFDocument(new
FileInputStream("C:\\Desktop\\Blubber.doc"));
					  Range range = doc.getRange();
					

	            range.replaceText("$blubber", "muh");
	            OutputStream out = new
FileOutputStream("C:\\Desktop\\Blubber2.doc");
	        
	            doc.write(out);
	            
	            out.flush();
	            out.close();
	 
	            
	      
	    System.out.println("ready");
				} catch (FileNotFoundException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				} catch (IOException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
	 


However, if I want to open the resulting file, Word gives me the following
error message "The document is too large for Word"

It would be nice if they could help me, because I need this program 
Thanks you


Mime
View raw message