Is it possible to create different Header and footer in a word document?
Yes, it is possible to create different header and footer in a document by using the LinkToPrevious property of the Section object. By setting this property as false, we can create different header/footer for each section. Please find the below code snippet to do so
C#
WParagraph pa = new WParagraph(doc);
pa.AppendText("Page1_Header1");
doc.LastSection.HeadersFooters.Header.Paragraphs.Add(pa);
doc.AddSection();
doc.LastSection.HeadersFooters.LinkToPrevious = false;
pa = new WParagraph(doc);
pa.AppendText("Second Page _Header2");
pa.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Right;
doc.LastSection.HeadersFooters.Footer.Paragraphs.Add(pa);
VB
Dim pa As WParagraph = New WParagraph(doc)
pa.AppendText("Page1_Header1")
doc.LastSection.HeadersFooters.Header.Paragraphs.Add(pa)
doc.AddSection()
doc.LastSection.HeadersFooters.LinkToPrevious = False
pa = New WParagraph(doc)
pa.AppendText("Second Page _Header2")
pa.ParagraphFormat.HorizontalAlignment = Syncfusion.DocIO.DLS.HorizontalAlignment.Right
doc.LastSection.HeadersFooters.Footer.Paragraphs.Add(pa)