NativeExcel2 for .Net Developer's Reference

IPageSetup.CenterHeader Property

Returns or sets the center part of the header.

[Visual Basic]
PropertyCenterHeaderAsString
[C#]
stringCenterHeader{get;set;}
[C++]
__propertyString*get_CenterHeader();
__propertyvoidset_CenterHeader(String*);
[JScript]
functiongetCenterHeader():String
functionsetCenterHeader(String);

Property Value

String. Center part of the header.

Remarks

Special format codes can be used in the header text.

Example

This example prints the date and page number at the top of each page.

[C#]
book.Worksheets[1].PageSetup.CenterHeader = "&D page &P of &N";
[VisualBasic]
book.Worksheets(1).PageSetup.CenterHeader = "&D page &P of &N"
[C++]
book->Worksheets->Item[1]->PageSetup->CenterHeader = S"&D page &P of &N";

See Also

IPageSetup Interface | NativeExcel Namespace | Special Formatting Codes | LeftHeader | RightHeader | LeftFooter | CenterFooter | CenterFooter | PageSetup Property