NativeExcel for .NET Developer's Reference

Formatting Codes for Headers and Footers

The following special formatting codes can be included as a part of the header and footer properties (LeftHeader, CenterHeader, RightHeader, LeftFooter, CenterFooter, RightFooter).

Code Description
&LLeft aligns the characters that follow.
&CCenters the characters that follow.
&RRight aligns the characters that follow.
&ETurns double-underline printing on or off.
&XTurns superscript printing on or off.
&YTurns subscript printing on or off.
&BTurns bold printing on or off.
&ITurns italic printing on or off.
&UTurns underline printing on or off.
&STurns strikethrough printing on or off.
&DPrints the current date.
&TPrints the current time.
&FPrints the name of the document.
&APrints the name of the workbook tab.
&PPrints the page number.
&P+numberPrints the page number plus the specified number.
&P-numberPrints the page number minus the specified number.
&&Prints a single ampersand.
& "fontname"Prints the characters that follow in the specified font. Be sure to include the double quotation marks.
&nnPrints the characters that follow in the specified font size. Use a two-digit number to specify a size in points.
&NPrints the total number of pages in the document.