Skip to main content

How to: Print Titles on a Worksheet

This example demonstrates how to print titles (row and column headings) on every page. To do this, use the following members of the WorksheetPrintTitleOptions object, which can be accessed using the WorksheetPrintOptions.PrintTitles property.

Members

Description

WorksheetPrintTitleOptions.Rows

WorksheetPrintTitleOptions.SetRows

Repeat specific rows at the top of every printed page.

WorksheetPrintTitleOptions.Columns

WorksheetPrintTitleOptions.SetColumns

Repeat specific columns on the left side of every printed page.

// Access an object that contains print options.
WorksheetPrintOptions printOptions = worksheet.PrintOptions;
// Print the first column and the first row on every page.
printOptions.PrintTitles.SetColumns(0, 0);
printOptions.PrintTitles.SetRows(0, 0);

To remove print titles from a specific worksheet, use the WorksheetPrintTitleOptions.Clear method.

See Also