Return-Path: Delivered-To: apmail-poi-user-archive@www.apache.org Received: (qmail 65137 invoked from network); 22 Jan 2010 09:06:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jan 2010 09:06:57 -0000 Received: (qmail 18285 invoked by uid 500); 22 Jan 2010 09:06:56 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 18210 invoked by uid 500); 22 Jan 2010 09:06:56 -0000 Mailing-List: contact user-help@poi.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "POI Users List" Delivered-To: mailing list user@poi.apache.org Received: (qmail 18200 invoked by uid 99); 22 Jan 2010 09:06:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2010 09:06:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [193.186.16.13] (HELO sauxb.salomon.at) (193.186.16.13) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 22 Jan 2010 09:06:49 +0000 Received: from servex01.wamas.com (servex01.salomon.at [172.28.2.2]) by sauxb.salomon.at (8.12.10/8.12.10) with ESMTP id o0M96PaI010334 for ; Fri, 22 Jan 2010 10:06:26 +0100 (MET) X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4325 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: AW: Microsoft Word error after opening previous generated doc file Date: Fri, 22 Jan 2010 10:06:23 +0100 Message-ID: <18597F2B47F1394A9B309945EC72411202848C6F@servex01.wamas.com> In-Reply-To: <18597F2B47F1394A9B309945EC724112028023FC@servex01.wamas.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Microsoft Word error after opening previous generated doc file thread-index: AcqZBdKDJPHkAE3cSbeitIGi2wvIKACPE0Sg References: <18597F2B47F1394A9B309945EC724112028023FC@servex01.wamas.com> From: "Doppelhofer Andreas" To: "POI Users List" X-Scanned-By: MIMEDefang 2.54 on 172.28.2.13 Any idea?=20 > -----Urspr=FCngliche Nachricht----- > Von: Doppelhofer Andreas [mailto:Andreas.Doppelhofer@salomon.at]=20 > Gesendet: Dienstag, 19. Januar 2010 13:49 > An: user@poi.apache.org > Betreff: Microsoft Word error after opening previous=20 > generated doc file >=20 > Hi all, > Following code creates a new doc file from an existing empty doc file. > The generation terminates without error, but after opening=20 > the new "sample2.doc" file with Microsoft Word (2003 SP3) and=20 > trying to edit/add/remove the text, Microsoft Word ist=20 > getting "no response" and the only way to close Word is to=20 > kill it from Task Manager. > I tried to open the file with OpenOffice (3.1) and there only the "H" > from "Hello World!" is displayed. In OpenOffice i can=20 > add/remove... some text. >=20 > What's the error? I'm using poi-bin-3.6-20091214 on Windows.=20 > The "empty.doc" file is a doc file without any text or=20 > something in it. Just "create new file" and save it. >=20 > Thx dops >=20 > -- > public static void main(String[] args) throws IOException { >=20 > File file =3D new File("empty.doc"); > POIFSFileSystem fs1 =3D new POIFSFileSystem(new=20 > FileInputStream(file)); HWPFDocument doc =3D new HWPFDocument(fs1); >=20 > Range range =3D doc.getRange(); > CharacterRun run =3D range.insertAfter("Hello World!"); >=20 > OutputStream out =3D new FileOutputStream(new=20 > File("sample2.doc")); doc.write(out); out.flush(); out.close(); >=20 > } > -- --=20 Salomon Automation GmbH - Friesachstrasse 15 - A-8114 Friesach bei Graz Sitz der Gesellschaft: Friesach bei Graz UID-NR:ATU28654300 - Firmenbuchnummer: 49324 K Firmenbuchgericht: Landesgericht f=FCr Zivilrechtssachen Graz --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org