Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding headers and footers using jacob api or poi api  RSS feed

 
karthik eyan.v
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

please help me out, I am hanging with this concept.

The problem is I need to add a headers in ms word file using java. I come to know that the API is support for this task is 1.apache POI 2.jacob

I dont know which class file I need to use to do this, If anyone knows about this please let me know or send the URL's

Thankyou,
karthikeyan
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

You can find those libraries easily by googling for them. Jacob is a Java<-->COM wrapper, so in order to use that you'd still need to know how to use Word's COM objects to do this.

The POI change list claims that support for Word headers and footers has been added recently. That's not yet in any released version, so you need to get the source code out of the repository and compile it yourself. No big deal, though.
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can download the next POI release as binary from here: poi-bin-3.5-beta1-20080718

And then you can read about adding/modifying header/footer here: POI-HWPF - A Quick Guide (not the best guide - but it is something)

A testcase can be found here: TestHeaderStories.java

[EDIT]Version 3.5 does not have the Word API changes included...[/EDIT]
[ September 18, 2008: Message edited by: Rene Larsen ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Version 3.5 is the version that adds OOXML support. It is not the same as the 3.1.x version currently under development; that exists as source code only.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!