Hi,
I need Generating word document dynamically with header, footer with example using c# ..
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Jan 9, 2014, 10:34 PM EST
Dont duplicate the question.
Nice example here.
http://www.c-sharpcorner.com/UploadFile/muralidharan.d/how-to-create-word-document-using-C-Sharp/
Jasna Kozelj13 reputationPosted Mar 10, 2014, 11:14 AM EDT
Richard Porter34 reputationPosted Feb 16, 2015, 9:13 PM EST
Also here is a small demonstration sample how you can add header and footer:
var document = new DocumentModel(); var section = new Section(document, new Paragraph(document, "Hello World")); section.HeadersFooters.Add( new HeaderFooter(document, HeaderFooterType.HeaderDefault, new Paragraph(document, "Default header."))); section.HeadersFooters.Add( new HeaderFooter(document, HeaderFooterType.FooterDefault, new Paragraph(document, "Default footer."))); document.Sections.Add(section); document.Save("Sample.docx");