I'm tying to replace tokens in the header of docx file.I have handled the token replacement in paragraphs and tables but its not picking the header data. Im using apache poi 3.8 and coding in java using eclipse ID. Thanx
相关问题
- how to pass arraylist of objects to populate each
- HTTP request over IPv6
- Error: In C, got the error “dereferencing pointer
- android apache poi-ooxml causes build error 'a
- Error: How to read empty cell in Excel
相关文章
-
Is it bad to put elements within the <hea
- Identify which file has included some particular h
- Rendering plain text through PHP
- How to loop through all the rows and cells in an e
- Auto-Resize UITableView Headers on Rotate (Mostly
- Java Apache POI newline characters are ignored whe
- How to read authorization header in JAX-RS service
- How to know number of sheets in a workbook?
查看全部
This methods will replace all selected text, in tables, headers and paragraph, in the entire document.
Code referred by (edited Sep 30 '16 at 1:19, Julio Villane) works for only headers across the document. Thanks for the code. To Replace in Footer, Same code has to called inside iteration of FooterList. To Replace across the document other than Header and Footer, You have to call the replaceParagraph(), replaceTable() again,to replace text across the document, other than Header and Footer.
I don't know if you have got the solution for this question. But, I've tried to replace tokens in document header and it worked for me.
Hope this helps. :)
You can leverage "content controls" in MS Word. Then you can access the content controls using the openxml library. Content controls act as placeholders/input sections in Word documents. I'm not a Java guy, but just letting you know this is another method