Return-Path: Delivered-To: apmail-jakarta-poi-user-archive@www.apache.org Received: (qmail 44444 invoked from network); 19 Jan 2007 23:32:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jan 2007 23:32:02 -0000 Received: (qmail 26134 invoked by uid 500); 19 Jan 2007 23:32:07 -0000 Delivered-To: apmail-jakarta-poi-user-archive@jakarta.apache.org Received: (qmail 26112 invoked by uid 500); 19 Jan 2007 23:32:07 -0000 Mailing-List: contact poi-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "POI Users List" Reply-To: "POI Users List" Delivered-To: mailing list poi-user@jakarta.apache.org Received: (qmail 26101 invoked by uid 99); 19 Jan 2007 23:32:07 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2007 15:32:07 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (herse.apache.org: local policy) Received: from [81.169.146.162] (HELO mo-p00-ob.rzone.de) (81.169.146.162) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 19 Jan 2007 15:31:57 -0800 Received: from srv.lpz.q-17.de.local (dslb-088-074-147-068.pools.arcor-ip.net [88.74.147.68]) by post.webmailer.de (mrclete mo62) (RZmta 3.11) with ESMTP id j0JIiu4f02fdeE for ; Sat, 20 Jan 2007 00:31:33 +0100 (MET) Date: Sat, 20 Jan 2007 00:31:33 +0100 (MET) Received: (qmail 8483 invoked by uid 1016); 19 Jan 2007 23:30:52 -0000 Received: from 192.168.40.21 by srv (envelope-from , uid 1007) with qmail-scanner-1.25 ( Clear:RC:1(192.168.40.21):. Processed in 0.428478 secs); 19 Jan 2007 23:30:52 -0000 Received: from unknown (HELO pcrsc.admadic.de) (192.168.40.21) by srv.lpz.q-17.de.local with SMTP; 19 Jan 2007 23:30:50 -0000 Message-Id: <6.2.1.2.2.20070119221730.03ec8f80@srv.lpz.q-17.de.local> X-Mailer: QUALCOMM Windows Eudora Version 6.2.1.2 To: "POI Users List" From: Rainer Schwarze Subject: Re: Creating new word doc with POI In-Reply-To: <45B0A03A.1000707@rainer-klute.de> References: <8445730.post@talk.nabble.com> <45B0A03A.1000707@rainer-klute.de> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-RZG-AUTH: lUESeo99iNzPSoaxNYLEYM0vFQI= X-Virus-Checked: Checked by ClamAV on apache.org At 11:40 19.01.2007, Rainer Klute wrote: >hasiasat schrieb: >> Error getting property set with name =E2=99=A3DocumentSummaryInformation >> java.io.FileNotFoundException: no such entry: >> "=E2=99=A3DocumentSummaryInformation" >> Error getting property set with name =E2=99=A3SummaryInformation >> java.io.FileNotFoundException: no such entry: "=E2=99=A3SummaryInformatio= n" >> =20 > >The property sets DocumentSummaryInformation and SummaryInformation do >not belong to the Word document as such. You have to create them using >POI's HPSF component, see for >details. I don't know whether HWPF has any functionalities to >encapsulate the HPSF stuff for you. HWPFDocument is a subclass of POIDocument. That has readProperties() and writeProperties(...). readProperties() is called already, but upon a write the writeProperties is missing. To fix it add a line at the end of the function HWPFDocument.write(...) as shown below: public void write(OutputStream out) throws IOException { ... // spit out the Word document. POIFSFileSystem pfs =3D new POIFSFileSystem(); pfs.createDocument(new ByteArrayInputStream(mainBuf), "WordDocument"); pfs.createDocument(new ByteArrayInputStream(tableBuf), "1Table"); pfs.createDocument(new ByteArrayInputStream(dataBuf), "Data"); // write the properties: writeProperties(pfs); // <-- insert this pfs.writeFilesystem(out); } That should do it. Best wishes, Rainer --=20 Rainer Schwarze =20 --------------------------------------------------------------------- To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org Mailing List: http://jakarta.apache.org/site/mail2.html#poi The Apache Jakarta Poi Project: http://jakarta.apache.org/poi/