2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Section.HeadersFooters property is used to set the document headers and footers. We can insert document elements like images and tables inside the header and footer. Here is a code snippet that demonstrates the usage. C# // Creating a new document. WordDocument doc = new WordDocument(); // Add a new section to the document. IWSection section = doc.AddSection(); // Add a new paragraph for header to the document. IWParagraph headerPar = new WParagraph(doc); // Add the paragraph to the header section. section.HeadersFooters.Header.Paragraphs.Add(headerPar); // Add a new paragraph for header to the document. IWParagraph footerPar = new WParagraph(doc); // Add the paragraph to the Footer section. section.HeadersFooters.Footer.Paragraphs.Add(footerPar)
VB '' Creating a new document. Dim doc As WordDocument = New WordDocument() '' Add a new section to the document. Dim section As IWSection = doc.AddSection() '' Add a new paragraph for header to the document. Dim headerPar As IWParagraph = New WParagraph(doc) '' Add the paragraph to the header section. CType(section.HeadersFooters.Header.Paragraphs, WParagraphCollection).Add(headerPar) '' Add the paragraph to the Footer section. CType(section.HeadersFooters.Footer.Paragraphs, WParagraphCollection).Add(footerPar)
Here is the sample. |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.