You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by silvia <si...@gmail.com> on 2011/09/13 14:38:40 UTC

I need write in a bookmark in docx

Hello,
I have a docx with several bookmarks. I want to cross these bookmarks and in
each of them to write information.
I can get de name each bookmark, but I can't write in them.
XWPFDocument eldocx = new XWPFDocument(new FileInputStream(pathplantilla1));
		
Iterator<XWPFParagraph> itParagraph = eldocx.getParagraphsIterator(); 
while (itParagraph.hasNext()){ 
    XWPFParagraph paragraph  = itParagraph.next(); 
		                                        
    CTP ctp = paragraph.getCTP(); 
    java.util.List<CTBookmark> bookmarks = ctp.getBookmarkStartList();
		    
    Iterator itbookmarks = bookmarks.listIterator();
    while (itbookmarks.hasNext()){  
    	CTBookmark bookmark = (CTBookmark) itbookmarks.next();
    	System.out.println("Name : " + bookmark.getName());
    	String bookmarkName = bookmark.getName();
             if (bookmarkName == "Empresa") {
                     // I need HELP !!!
             }
    }
}

thank
silvia

--
View this message in context: http://apache-poi.1045710.n5.nabble.com/I-need-write-in-a-bookmark-in-docx-tp4798359p4798359.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