I don't think HWPF supports adding headers or footers directly, but if you base your document on an existing one (as demonstrated in http://faq.javaranch.com/java/CreateWordDocument) you may be able to use any header/footer that happens to exist in that document already.
Replacing text inside of a DOC document is discussed in this topic.
Ulf Dittmer wrote:I don't think HWPF supports adding headers or footers directly, but if you base your document on an existing one (as demonstrated in http://faq.javaranch.com/java/CreateWordDocument) you may be able to use any header/footer that happens to exist in that document already.
Replacing text inside of a DOC document is discussed in this topic.
hi
when I replace words of different length the result file is corrupt
Interesting. A DOC file so changed is opened fine by both OpenOffice and Mellel (an OS X word processor), but not by Word itself. Might be something to ask on the POI mailing list about.