You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by vasavi <va...@gmail.com> on 2011/04/29 06:39:53 UTC

count number of tables in a word document

hi 

can any body tell  how to count number of tables in word document using
XWPF.

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/count-number-of-tables-in-a-word-document-tp4357876p4357876.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


RE: count number of tables in a word document

Posted by Pere Torrodellas <pt...@fihoca.com>.
Hello,

I'm pretty new to XWPF and maybe this does not always work, but I can tell
you that for a not very complex document the following code prints the
number of tables:

XWPFDocument doc = new XWPFDocument(new FileInputStream("mydoc.docx"));
System.out.println(String.valueOf(doc.getTables().size()));

HTH.

Pere

> -----Mensaje original-----
> De: vasavi [mailto:vasavi512@gmail.com]
> Enviado el: viernes, 29 de abril de 2011 6:40
> Para: user@poi.apache.org
> Asunto: count number of tables in a word document
>
> hi
>
> can any body tell  how to count number of tables in word
> document using
> XWPF.
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/count-number-of-tables
> -in-a-word-document-tp4357876p4357876.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
>
>


AVÍS DE CONFIDENCIALITAT: Aquest missatge i els seus documents adjunts, poden contenir informació privilegiada i/o confidencial que està dirigida exclusivament al seu destinatari. Si vostè rep aquest missatge i no és el destinatari indicat, si us plau notifiqui-ho immediatament i remeti el missatge original a l'adreça electrònica indicada. Qualsevol còpia, ús o distribució no autoritzats d'aquesta comunicació queda estrictament prohibida.

AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden contener información privilegiada y/o confidencial que está dirigida exclusivamente a su destinatario. Si usted recibe este mensaje y no es el destinatario indicado, por favor notifíquelo inmediatamente y remita el mensaje original a la dirección electrónica indicada. Cualquier copia, uso o distribución no autorizados de esta comunicación queda estrictamente prohibida.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org