I am using Office 2003 on Windows XP.

Saving an Word file as an HTML works great - the only thing is, it doesn't
include the headers and footers in the document.

Does anyone know how to include them when a file is "saved-as" an HTML? Or
is there an alternative solution other than "save-as" (within Word)?

I need a VBA or VB-script solution. Can someone please post some example
code or otherwise enlighten me? Thanks much in advance for your assistance.

Re: Include headers/footers when saving as HTML by Jay

Jay
Tue May 24 13:46:06 CDT 2005

quartz wrote:
> I am using Office 2003 on Windows XP.
>
> Saving an Word file as an HTML works great - the only thing is, it
> doesn't include the headers and footers in the document.
>
> Does anyone know how to include them when a file is "saved-as" an
> HTML? Or is there an alternative solution other than "save-as"
> (within Word)?
>
> I need a VBA or VB-script solution. Can someone please post some
> example code or otherwise enlighten me? Thanks much in advance for
> your assistance.

Considering that HTML doesn't have any concept of "pages", where/how do you
expect Word to display the header and footer? They're omitted by design
because they don't make sense.

If you want one copy of the header at the top of the web "page" and one copy
of the footer at the bottom, you'll have to put them there yourself. Make a
copy of the Word document, cut the header content and paste it into the body
of the document at the top, and repeat for the footer at the bottom.
Remember to delete any Page, NumPages, SectionPages, or PageRef fields,
because they'll all display just "1". Then save the result as HTML.

I suppose this could be written as a macro, but it isn't the sort of thing
I'd do more than very occasionally.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org