Can I export to HTML ONLY the text- NOT the headers and footers?


#1

I am using this code:

doc.Save(strHtmlFilename,Aspose.Word.SaveFormat.FormatHtml);

to save the text of a .doc file to an HTML file. I would like to include only the text, not the headers and footers. It used to work that way (ignoring headers and footers) but since a recent update, it now sends out the header and footer as well (and not really well formatted).

Thanks in advance.


#2

You can workaround if you clear headers and footers from the document before you export to HTML, use Section.ClearStory. You can get away with just calling ClearStory(StoryType.PrimaryHeaderStory) as only the primary header is exported.

We will later add an option to export or suppress export of headers to HTML.