Worksheet.HPageBreaks Property (2007 System)
Gets an HPageBreaks collection that represents the horizontal page breaks on the sheet.
Namespace: Microsoft.Office.Tools.Excel
Assembly: Microsoft.Office.Tools.Excel.v9.0 (in Microsoft.Office.Tools.Excel.v9.0.dll)
Syntax
'Declaration
<BrowsableAttribute(False)> _
Public ReadOnly Property HPageBreaks As HPageBreaks
'Usage
Dim instance As Worksheet
Dim value As HPageBreaks
value = instance.HPageBreaks
[BrowsableAttribute(false)]
public HPageBreaks HPageBreaks { get; }
[BrowsableAttribute(false)]
public:
property HPageBreaks^ HPageBreaks {
HPageBreaks^ get ();
}
public function get HPageBreaks () : HPageBreaks
Property Value
Type: HPageBreaks
An HPageBreaks collection that represents the horizontal page breaks on the sheet.
Remarks
There is a limit of 1026 horizontal page breaks per 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 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
private void InsertPageBreaks()
{
Excel.HPageBreak hbreak =
this.HPageBreaks.Add(this.Range["C5", missing]);
Excel.VPageBreak vbreak =
this.VPageBreaks.Add(this.Range["C5", missing]);
}
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.