PDA

View Full Version : How to restore Header and Footer in a DOC --> HTML --> DOC situation


izchak
September 13, 2004, 18:15:41
Hi guys,

Here is what we do:
We take a word document, convert it to HTML, and allow the users to edit it via a web-based HTML editor.

After the HTML is saved, we save the result file back into a DOC file.

Naturally, since the HTML does not have any footer/header information in it, none of that information is passed to the newly created DOC file.

The question is, how do I go about this problem?

Is it possible to access the "old" DOC file (the original one, that has the header and the footer in it), and copy the header/footer to the newly created DOC file? If so, would you be so kind to show me the way?

Thanks!

I am looking forward to your reply.

Björn Meyer
September 23, 2004, 13:19:26
Hello

Yes, this would be possible. Load the old document into TX Text Control 1 and load the new document into TX Text Control 2. Now, select the header using the SelStart / SelLength properties of TX Text Control 1 and copy the contents using SaveToMemoryBuffer into a variable. This variable can be inserted into the header of TX Text Control 2 using LoadFromMemory. In both cases, the CurSelection parameter of LoadFrom-/SaveToMemoryBuffer must be set to true.