![]() Links the current section’s header or footer to the next section’s header or footer. Specifies whether the even-numbered pages should have a different header or footer than odd-numbered pages. Use the following API to change header/footer options in code: APIĭefines whether to display a different header/footer (if any) for the section’s first page. ' Display the header of the HeaderFooterType.First type on the first page. ' Modify the header of the HeaderFooterType.First type.ĭim myHeader As SubDocument = firstSection.BeginUpdateHeader(HeaderFooterType.First)ĭim range As DocumentRange = myHeader.InsertText(myHeader.CreatePosition(0), " PAGE NUMBER ")ĭim fld As Field = (range.End, "PAGE \* ARABICDASH") Display the header of the HeaderFooterType.First type on the first page.ĭim document As Document = server.Document SubDocument myHeader = firstSection.BeginUpdateHeader(HeaderFooterType.First) ĭocumentRange range = myHeader.InsertText(myHeader.CreatePosition(0), " PAGE NUMBER ") įield fld = (range.End, "PAGE \\* ARABICDASH") Modify the header of the HeaderFooterType.First type. ![]() You cannot add comments to headers’ or footers’ text. Headers and footers can contain inline images, floating objects (text boxes or images) and tables. Call the Section.BeginUpdateHeader or Section.BeginUpdateFooter method to access the header’s or footer’s content. Headers’ and footers’ content are in a separate SubDocument. If Not firstSection.HasHeader(HeaderFooterType.Primary) Thenĭim headerDocument As SubDocument = firstSection.BeginUpdateHeader()įirstSection.EndUpdateHeader(headerDocument) ![]() ' Check whether the document already has a header (the same header for all pages). Using wordProcessor As New RichEditDocumentServer()ĭim document As Document = wordProcessor.Documentĭim firstSection As Section = document.Sections(0) SubDocument headerDocument = firstSection.BeginUpdateHeader() įirstSection.EndUpdateHeader(headerDocument) If (!firstSection.HasHeader(HeaderFooterType.Primary)) Check whether the document already has a header (the same header for all pages). Section firstSection = document.Sections Using (RichEditDocumentServer wordProcessor = new RichEditDocumentServer())ĭocument document = wordProcessor.Document The code sample below creates an empty document header: Use the following API to access headers and footers in code: APIĪccesses the document’s header or footer.Ĭhecks whether the given section contains a header or footer. Pass one of the HeaderFooterType enumeration values as a type parameter to define the header or footer’s type. You can use the Section.BeginUpdateHeader and Section.BeginUpdateFooter methods to access the section’s header or footer. When you create a new section, it is automatically linked to the previous section and the content from the first section header is automatically inserted in the second section header. If a section does not have header or footer, the previous section’s header and footer (if any) are used. Headers and footers belong to document sections.
0 Comments
Leave a Reply. |