Off of the top of my head, no I cannot offer you any Java code that will accomplish this task but may be able to point you in the right direction.
I do not know if this is the case, but I would expect a textbox to be considered a shape. There is a method defined on the HWPFDocument class called getShapesTable() that returns an instance of the ShapesTable class from which you can get a List of the Shapes in the document by calling the getAllShapes() or getVisibleShapes() methods. I have never tried this so do not know if it will work; even then you may be faced with the problem of distinguishing a specific textbox from all of the others in the document. Can I ask what control you have over the template? Could you insert placeholders - bookmarks in effect - into the textboxes? If so, then you can simply use the replaceText() methods that are defined on the Range class. To be sure that you preserve any formatting that may be applied to the placeholder, you will most likely need to recover it as an instance of the CharacterRun class; this is a subclass of Range so should be easy enough to do. Hope that helps. Yours Mark B tapaswini wrote: > > i want to insert different data into different textboxes of wordTemplate > using HWPF doccument.can some body help me?????????:working: > -- View this message in context: http://www.nabble.com/insert-data-into-different-textboxes-using-HWPF-tp23960543p23965914.html Sent from the POI - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
