Return-Path: Delivered-To: apmail-poi-user-archive@www.apache.org Received: (qmail 34696 invoked from network); 26 Feb 2009 17:00:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Feb 2009 17:00:13 -0000 Received: (qmail 55417 invoked by uid 500); 26 Feb 2009 17:00:12 -0000 Delivered-To: apmail-poi-user-archive@poi.apache.org Received: (qmail 54978 invoked by uid 500); 26 Feb 2009 17:00:11 -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 54963 invoked by uid 99); 26 Feb 2009 17:00:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2009 09:00:11 -0800 X-ASF-Spam-Status: No, hits=3.1 required=10.0 tests=DNS_FROM_OPENWHOIS,FROM_LOCAL_NOVOWEL,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Feb 2009 17:00:02 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1LcjaH-0003rL-Ft for user@poi.apache.org; Thu, 26 Feb 2009 08:59:41 -0800 Message-ID: <22228552.post@talk.nabble.com> Date: Thu, 26 Feb 2009 08:59:41 -0800 (PST) From: MSB To: user@poi.apache.org Subject: Re: Q: How to check if a Word .doc file is a mail merge master file? In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: markbrdsly@tiscali.co.uk References: X-Virus-Checked: Checked by ClamAV on apache.org Hello Christian, I would guess that the answer to your second question is yes. It is possibl= e to use HWPF to extract the data from a Word document - in fact Nick has built a class that does just this and it is called WordExtractor I think. I= t returns an array of Strings if I remember correctly and it would not be too difficult to imagine that you could check the complete set of values returned and if - only if - that complete set was limited to your 'table structure' (if I understand that correctly) then the document would pass your validation test. To answer your first question, I need to ask another one; what set or criteria distinguish a mail merge master file from any other document or document template that could be created using Word? If you are able to formulate such a list then it would be possible to determine if HWPF could be used to parse the Word file and determine it's status. Christian Gosch-2 wrote: >=20 > Is it possible using POI to check if a given Word *.doc file=20 > (Word2K/2003) is a Mail Merge master file? >=20 > Is it then possible to retrieve or find by inspection the mail merge=20 > data field references used in the mail merge master file? >=20 > We do not need to change anything, we just want to check if a given file= =20 > is a valid mail merge master and matches a given and known "table=20 > structure", i. e. uses only a given set of mail merge data field=20 > references. (validation) >=20 > Up to now, our validation just checks the file extension and does not=20 > execute any introspection. >=20 > Thanks for answers, > --=20 > Dipl.-Inform. Christian Gosch, PMI PMP > Systems Architecture, Project Management >=20 > inovex GmbH > B=C3=BCro Pforzheim > Karlsruher Strasse 71 > D-75179 Pforzheim > Tel: +49 (0)7231 3191-85 > Fax: +49 (0)7231 3191-91 > c.gosch@inovex.de > www.inovex.de >=20 > Sitz der Gesellschaft: Pforzheim > AG Mannheim, HRB 502126 > Gesch=C3=A4ftsf=C3=BChrer: Stephan M=C3=BCller=20 >=20 >=20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@poi.apache.org > For additional commands, e-mail: user-help@poi.apache.org >=20 >=20 >=20 --=20 View this message in context: http://www.nabble.com/Q%3A-How-to-check-if-a-= Word-.doc-file-is-a-mail-merge-master-file--tp22220571p22228552.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@poi.apache.org For additional commands, e-mail: user-help@poi.apache.org