• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Adding headers and footers using jacob api or poi api

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic