Free Support Forum -

Clear content but NOT header and footer

I am using the following code that I have ported over and made changes from the older Aspose.Word component (I am currently using I am trying to clear the text, but NOT the header and footer. Is this code correct for that purpose? If so, why might headers and footers be deleted?

Aspose.Words.Section sec=doc.Sections[0];


// This is what I did in the old Aspose.Word code which worked
// doc.Sections[0].ClearStory(Aspose.Words.StoryType.MainTextStory);

The following code removes section content but keeps headers/footers:



Thanks. I will try that.