Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Thu Jan 10, 2019 5:15 am

Hi,

Kindly check my code below, in InvestigationSection in the last footer, there is a table I want to hide (Just in the last footer for the section)

Code: Select all
Section InvestigationSection = document.AddSection();

InvestigationSection.PageSetup.InsertPageNumbers(false, Spire.Doc.Documents.PageNumberAlignment.Left);

InvestigationSection.AddParagraph().AppendHTML(InvestigationContent);

InvestigationSection.HeadersFooters.LinkToPrevious = false;// added by jane

InvestigationSection.HeadersFooters.Header.AddParagraph().AppendHTML(Header);

InvestigationSection.HeadersFooters.Footer.AddParagraph().AppendHTML(InvestigationFooter);

InvestigationSection.Paragraphs[InvestigationSection.Paragraphs.Count - 1].InsertSectionBreak(Spire.Doc.Documents.SectionBreakType.NoBreak);

 

// Decision Section

Section DecisionSection = null;

if (DecisionContent.Length > 0)

{

    DecisionSection = document.AddSection();

    DecisionSection.AddParagraph().AppendHTML(DecisionContent);

    DecisionSection.HeadersFooters.LinkToPrevious = false;// added by jane

    DecisionSection.HeadersFooters.Header.AddParagraph().AppendHTML(Header);

    DecisionSection.HeadersFooters.Footer.AddParagraph().AppendHTML(DecisionFooter);

}

ms = new MemoryStream();

document.SaveToStream(ms, FileFormat.Docx);


Regards,

mkm090
 
Posts: 7
Joined: Tue Dec 01, 2015 10:25 am

Thu Jan 10, 2019 9:22 am

Hi,

Thanks for your inquiry.
There is no way to hide a table in Word, but you could delete it using the code below.
Code: Select all
int tableCount = InvestigationSection.HeadersFooters.Footer.Tables.Count;
if (tableCount!=0)
{
     InvestigationSection.HeadersFooters.Footer.ChildObjects.Remove(InvestigationSection.HeadersFooters.Footer.Tables[0]);
}

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.Doc