本文為機器翻譯文章。如需檢視英文版,請選取 [原文] 核取方塊。您也可以將滑鼠指標移到文字上,即可在快顯視窗顯示英文原文。
譯文
原文

NamedRange.PageBreak 屬性

 

取得或設定分頁符號的位置。

命名空間:   Microsoft.Office.Tools.Excel
組件:  Microsoft.Office.Tools.Excel (於 Microsoft.Office.Tools.Excel.dll)

int PageBreak { get; set; }

屬性值

Type: System.Int32

分頁符號的位置。

You can set this property using one of the following T:Microsoft.Office.Interop.Excel.XlPageBreakvalues:

This property can return the location of either automatic or manual page breaks, but it can only set the location of manual breaks (it can only be set to F:Microsoft.Office.Interop.Excel.XlPageBreak.xlPageBreakManual or F:Microsoft.Office.Interop.Excel.XlPageBreak.xlPageBreakNone).

The following code example creates a T:Microsoft.Office.Tools.Excel.NamedRange and then uses the P:Microsoft.Office.Tools.Excel.NamedRange.PageBreak property to set a page break at the T:Microsoft.Office.Tools.Excel.NamedRange.

This example is for a document-level customization.

Microsoft.Office.Tools.Excel.NamedRange pageBreakRange;
private void SetPageBreak()
{
    pageBreakRange = this.Controls.AddNamedRange(
         this.Range["C4"], "pageBreakRange");
    this.pageBreakRange.PageBreak =
        (int)Excel.XlPageBreak.xlPageBreakManual;
}
回到頁首
顯示: