poi-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From silvia <silviagalv...@gmail.com>
Subject I need write in a bookmark in docx
Date Tue, 13 Sep 2011 12:38:40 GMT
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


Mime
View raw message