officefileapi-119926-spreadsheet-document-api-examples-printing-how-to-print-titles-on-a-worksheet.md
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);
' Access an object that contains print options.
Dim printOptions As WorksheetPrintOptions = 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