WorksheetBase.HPageBreaks Property

Definition

Gets an HPageBreaks collection that represents the horizontal page breaks on the sheet.

public:
 property Microsoft::Office::Interop::Excel::HPageBreaks ^ HPageBreaks { Microsoft::Office::Interop::Excel::HPageBreaks ^ get(); };
public Microsoft.Office.Interop.Excel.HPageBreaks HPageBreaks { get; }
member this.HPageBreaks : Microsoft.Office.Interop.Excel.HPageBreaks
Public ReadOnly Property HPageBreaks As HPageBreaks

Property Value

An HPageBreaks collection that represents the horizontal page breaks on the sheet.

Examples

The following code example uses the HPageBreaks property to add a horizontal page break at cell C5.

This example is for a document-level customization.

private void InsertPageBreaks()
{
    Excel.HPageBreak hbreak =
        this.HPageBreaks.Add(this.Range["C5"]);
    Excel.VPageBreak vbreak =
        this.VPageBreaks.Add(this.Range["C5"]);
}
Private Sub InsertPageBreaks()
    Dim hbreak As Excel.HPageBreak = _
        Me.HPageBreaks.Add(Me.Range("C5"))
    Dim vbreak As Excel.VPageBreak = _
        Me.VPageBreaks.Add(Me.Range("C5"))
End Sub

Remarks

There is a limit of 1026 horizontal page breaks per sheet.

Applies to