概述 | 软件包 | 类 | 树 | 索引 | 帮助

上一个类 下一个类 | 框架 无框架
摘要： 嵌套 | 字段 | 构造函数 | 方法 | 详细信息： 字段 | 构造函数 | 方法

## application.workbooks.workbook.style.border
类 PageBorderAttribute

    java.lang.Object
      application.workbooks.workbook.style.border.PageBorderAttribute

    public class PageBorderAttribute

extends java.lang.Object

页面边框属性

自从：
  1.3

构造函数摘要
`PageBorderAttribute()` 初始化

方法摘要
`java.awt.Color` | `getBorderLineColor(int borderPosition)` 得到边框线颜色。
`int` | `getBorderLineType(int borderPosition)` 得到边框线类型。
`float` | `getBorderLineWidth(int borderPosition)` 得到边框线宽度（以磅值为默认单位）。
`int` | `getBorderType()` 得到边框类型。
`int` | `getBottomDistance()` 获取页面边框与页面下边距或纸张下边缘之间的距离（以磅值为默认单位）。
`int` | `getDistanceFrom()` 获取边框的度量依据（即设置的距离是页面与边框之间的距离，还是正文与边框之间的距离）。
`int` | `getLeftDistance()` 获取页面边框与页面左边距或纸张左边缘之间的距离（以磅值为默认单位）。
`int` | `getRightDistance()` 获取页面边框与页面右边距或纸张右边缘之间的距离（以磅值为默认单位）。
`int` | `getTopDistance()` 获取页面边框与页面上边距或纸张上边缘之间的距离（以磅值为默认单位）。
`boolean` | `isAlignWithPage()` 判断是否将段落边框与表格边界与页面边框对齐。
`boolean` | `isShowInFront()` 判断页面边框是否总在最上方显示。
`boolean` | `isSurroundFooter()` 判断是否将页脚包含在页面边框之内。
`boolean` | `isSurroundHeader()` 判断是否将页眉包含在页面边框之内。
`void` | `setAlignWithPage(boolean flag)` 将段落边框与表格边界与页面边框对齐。
`void` | `setBorderLineColor(int borderPosition, java.awt.Color color)` 设置边框线颜色。
`void` | `setBorderLineType(int borderPosition, int lineType)` 设置边框线条属性。
`void` | `setBorderLineWidth(int borderPosition, float width)` 设置边框线宽度（以磅值为默认单位）。
`void` | `setBorderType(int borderType)` 设置边框类型。
`void` | `setBottomDistance(int bottom)` 设置页面边框与页面下边距或纸张下边缘之间的距离（以磅值为默认单位）。
`void` | `setDistanceFrom(int ind)` 设置边框的度量依据（即设置的距离是页边距与边框之间的距离，还是纸张边缘与边框之间的距离）。
`void` | `setLeftDistance(int left)` 设置页面边框与页面左边距或纸张左边缘之间的距离（以磅值为默认单位）。
`void` | `setRightDistance(int right)` 设置页面边框与页面右边距或纸张右边缘之间的距离（以磅值为默认单位）。
`void` | `setShowInFront(boolean flag)` 页面边框总在最前面显示。
`void` | `setSurroundFooter(boolean flag)` 将页脚包含在页面边框之内。
`void` | `setSurroundHeader(boolean flag)` 将页眉包含在页面边框之内。
`void` | `setTopDistance(int top)` 设置页面边框与页面上边距或纸张上边缘之间的距离（以磅值为默认单位）。

从类 java.lang.Object 继承的方法
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

构造函数详细信息

### PageBorderAttribute

    public PageBorderAttribute()

  初始化

方法详细信息

### getBorderLineColor

    public java.awt.Color getBorderLineColor(int borderPosition)

  得到边框线颜色。

  参数：
    `borderPosition` - 边缘边框类型，其常量和相应的值如下：

         BorderAndShadingConstants.LEFT = 0       左边缘边框
         BorderAndShadingConstants.TOP = 1        上边缘边框
         BorderAndShadingConstants.RIGHT = 2      右边缘边框
         BorderAndShadingConstants.BOTTOM = 3     下边缘边框

  返回：
    边框线颜色

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();

         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);

         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

         System.out.println(doc.getPageBorderAttribute().getBorderLineColor(BorderAndShadingConstants.BOTTOM));

  另请参见：
    `BorderAndShadingConstants`

### getBorderLineType

    public int getBorderLineType(int borderPosition)

  得到边框线类型。

  参数：
    `borderPosition` - 边缘边框类型，其常量和相应的值如下：

         BorderAndShadingConstants.LEFT = 0       左边缘边框
         BorderAndShadingConstants.TOP = 1        上边缘边框
         BorderAndShadingConstants.RIGHT = 2      右边缘边框
         BorderAndShadingConstants.BOTTOM = 3     下边缘边框

  返回：
    边框线类型

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();

         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);

         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

         System.out.println(doc.getPageBorderAttribute().getBorderLineType(BorderAndShadingConstants.TOP));

  另请参见：
    `setBorderLineType(int borderPosition, int lineType)`, `BorderAndShadingConstants`

### getBorderLineWidth

    public float getBorderLineWidth(int borderPosition)

  得到边框线宽度（以磅值为默认单位）。

  参数：
    `borderPosition` - 边缘边框类型，其常量和相应的值如下：

         BorderAndShadingConstants.LEFT = 0       左边缘边框
         BorderAndShadingConstants.TOP = 1        上边缘边框
         BorderAndShadingConstants.RIGHT = 2      右边缘边框
         BorderAndShadingConstants.BOTTOM = 3     下边缘边框

  返回：
    边框线条宽度 说明：get方法默认返回为磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字），可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

         System.out.println(doc.getPageBorderAttribute().getBorderLineWidth(BorderAndShadingConstants.BOTTOM));

  另请参见：
    `setBorderLineWidth(int borderPosition, float width)`, `BorderAndShadingConstants`

### getBorderType

    public int getBorderType()

  得到边框类型。

  返回：
    边框的类型，其常量和相应的值如下：

         BorderAndShadingConstants.BORDERTYPE_NONE = 0    表示无边框
         BorderAndShadingConstants.BORDERTYPE_BOX = 1     表示方框格式
         BorderAndShadingConstants.BORDERTYPE_SHADOW = 2  表示在所选内容四周加上边框，并应用预设的阴影格式
         BorderAndShadingConstants.BORDERTYPE_THREED = 3  表示在所选内容四周加上边框，并应用预设的三维边框格式
         BorderAndShadingConstants.BORDERTYPE_CUSTOM = 4  表示自定义格式

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

         System.out.println(doc.getPageBorderAttribute().getBorderType());

### getBottomDistance

    public int getBottomDistance()

  获取页面边框与页面下边距或纸张下边缘之间的距离（以磅值为默认单位）。

  返回：
    页面边框与页面下边距或纸张下边缘之间的距离 说明：get方法默认返回为磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字），可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setBottomDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

         int optionBottom = doc.getPageBorderAttribute().getBottomDistance();
         System.out.println("边框与页面之间下边距的距离是：" + optionBottom);

### getDistanceFrom

    public int getDistanceFrom()

  获取边框的度量依据（即设置的距离是页面与边框之间的距离，还是正文与边框之间的距离）。

  返回：
    度量依据，只能取以下两个整形值之一：

         0 - 表示设置的距离是页边距与边框之间的距离
         1 - 表示示设置的距离是纸张边缘与边框之间的距离

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setDistanceFrom(0);

         doc.setPageBorderAttribute(pageBorderAttr);
         System.out.println(doc.getPageBorderAttribute().getDistanceFrom());

### getLeftDistance

    public int getLeftDistance()

  获取页面边框与页面左边距或纸张左边缘之间的距离（以磅值为默认单位）。

  返回：
    页面边框与页面左边距或纸张左边缘之间的距离 说明：get方法默认返回为磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字），可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setLeftDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

         int optionLeft = pageBorderAttr.getLeftDistance();
         System.out.println("边框与页面之间左边距的距离是：" + optionLeft);

### getRightDistance

    public int getRightDistance()

  获取页面边框与页面右边距或纸张右边缘之间的距离（以磅值为默认单位）。

  返回：
    页面边框与页面右边距或纸张右边缘之间的距离 说明：get方法默认返回为磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字），可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setRightDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

         int optionRight = doc.getPageBorderAttribute().getRightDistance();
         System.out.println("边框与页面之间右边距的距离是：" + optionRight);

### getTopDistance

    public int getTopDistance()

  获取页面边框与页面上边距或纸张上边缘之间的距离（以磅值为默认单位）。

  返回：
    页面边框与页面上边距或纸张上边缘之间的距离 说明：get方法默认返回为磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字），可以用 application.util.Utilities.pointToOther(double, int)方法将返回的磅值转换为其他度量单位。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setTopDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);
         int optionTop = pageBorderAttr.getTopDistance();
         System.out.println("边框与页面之间上边距的距离是：" + optionTop);

### isAlignWithPage

    public boolean isAlignWithPage()

  判断是否将段落边框与表格边界与页面边框对齐。
  (注：必须设置当前的度量依据为正文，才能设置段落边框与表格边界与页面边框对齐。)

  返回：
    布尔型值，如果段落边框与表格边界与页面边框对齐，返回true；否则，返回false

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setAlignWithPage(true);

         doc.setPageBorderAttribute(pageBorderAttr);
         System.out.println(doc.getPageBorderAttribute().isAlignWithPage());

### isShowInFront

    public boolean isShowInFront()

  判断页面边框是否总在最上方显示。

  返回：
    flag 布尔型值，如果页面边框总在前面显示，返回true；否则，返回false

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setShowInFront(true);

         doc.setPageBorderAttribute(pageBorderAttr);
         System.out.println(doc.getPageBorderAttribute().isShowInFront());

### isSurroundFooter

    public boolean isSurroundFooter()

  判断是否将页脚包含在页面边框之内。
  注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页脚就是使边框的下边距为边框与页脚底边之间的距离。

  返回：
    布尔型值，如果将页脚包含在页面边框之内，返回true；否则，返回false

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setSurroundFooter(true);

         doc.setPageBorderAttribute(pageBorderAttr);
         System.out.println(doc.getPageBorderAttribute().isSurroundFooter());

### isSurroundHeader

    public boolean isSurroundHeader()

  判断是否将页眉包含在页面边框之内。
  (注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页眉就是使边框的上边距为边框与页眉顶边之间的距离。)

  返回：
    布尔型值，如果页眉包含在页面边框之内，返回true；否则，返回false

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setSurroundHeader(true);

         doc.setPageBorderAttribute(pageBorderAttr);
         System.out.println(doc.getPageBorderAttribute().isSurroundHeader());

### setAlignWithPage

    public void setAlignWithPage(boolean flag)

  将段落边框与表格边界与页面边框对齐。（即设置“段落边框与表格边界与页面边框对齐”）
  注：必须设置当前的度量依据为正文，才能设置段落边框与表格边界与页面边框对齐。

  参数：
    `flag` - 布尔型值，如为true，表示将段落边框与表格边界与页面边框对齐；否则，段落边框与表格边界不对齐页面边框

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setAlignWithPage(true);

         doc.setPageBorderAttribute(pageBorderAttr);

### setBorderLineColor

    public void setBorderLineColor(int borderPosition,
                                   java.awt.Color color)

  设置边框线颜色。

  参数：
    `borderPosition` - 边缘边框类型，其常量和相应的值如下：

         BorderAndShadingConstants.LEFT = 0       左边缘边框
         BorderAndShadingConstants.TOP = 1        上边缘边框
         BorderAndShadingConstants.RIGHT = 2      右边缘边框
         BorderAndShadingConstants.BOTTOM = 3     下边缘边框

    `color` - 边框线颜色，如Color.red

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();

         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);

         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

  另请参见：
    `getBorderLineColor(int borderPosition)`, `BorderAndShadingConstants`

### setBorderLineType

    public void setBorderLineType(int borderPosition,
                                  int lineType)

  设置边框线条属性。

  参数：
    `borderPosition` - 边缘边框类型，其常量和相应的值如下：

         BorderAndShadingConstants.LEFT = 0       左边缘边框
         BorderAndShadingConstants.TOP = 1        上边缘边框
         BorderAndShadingConstants.RIGHT = 2      右边缘边框
         BorderAndShadingConstants.BOTTOM = 3     下边缘边框

    `lineType` - 线条类型

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();

         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);

         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

  抛出：
    `MacroRunException` - 指定边缘边框类型常量不存在
    `MacroRunException` - 指定线条类型不存在

### setBorderLineWidth

    public void setBorderLineWidth(int borderPosition,
                                   float width)

  设置边框线宽度（以磅值为默认单位）。

  参数：
    `borderPosition` - 边缘边框类型，其常量和相应的值如下：

         BorderAndShadingConstants.LEFT = 0       左边缘边框
         BorderAndShadingConstants.TOP = 1        上边缘边框
         BorderAndShadingConstants.RIGHT = 2      右边缘边框
         BorderAndShadingConstants.BOTTOM = 3     下边缘边框

    `width` - 边框线条的宽度 说明：set方法的参数默认取磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字）， 可以用 application.util.Utilities.otherToPoint(double, int)方法将其他度量单位转换为磅值后再调用相应的设置方法。

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();

         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);

         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

  抛出：
    `MacroRunException` - 当参数borderPosition超出范围
  另请参见：
    `getBorderLineWidth(int borderPosition)`

### setBorderType

    public void setBorderType(int borderType)

  设置边框类型。

  参数：
    `borderType` - 边框的类型，其常量和相应的值如下：

         BorderAndShadingConstants.BORDERTYPE_NONE = 0    表示无边框
         BorderAndShadingConstants.BORDERTYPE_BOX = 1     表示方框格式
         BorderAndShadingConstants.BORDERTYPE_SHADOW = 2  表示在所选内容四周加上边框，并应用预设的阴影格式
         BorderAndShadingConstants.BORDERTYPE_THREED = 3  表示在所选内容四周加上边框，并应用预设的三维边框格式
         BorderAndShadingConstants.BORDERTYPE_CUSTOM = 4  表示自定义格式

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);
         doc.setPageBorderAttribute(pageBorderAttr);

### setBottomDistance

    public void setBottomDistance(int bottom)

  设置页面边框与页面下边距或纸张下边缘之间的距离（以磅值为默认单位）。

  参数：
    `bottom` - 页面边框与页面下边距或纸张下边缘之间的距离 说明：set方法的参数默认取磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字）， 可以用 application.util.Utilities.otherToPoint(double, int)方法将其他度量单位转换为磅值后再调用相应的设置方法。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setBottomDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

### setDistanceFrom

    public void setDistanceFrom(int ind)

  设置边框的度量依据（即设置的距离是页边距与边框之间的距离，还是纸张边缘与边框之间的距离）。

  参数：
    `ind` - 度量依据，只能取以下两个整形值之一：

         0 - 表示设置的距离是页边距与边框之间的距离
         1 - 表示示设置的距离是纸张边缘与边框之间的距离

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setDistanceFrom(0);

         doc.setPageBorderAttribute(pageBorderAttr);

### setLeftDistance

    public void setLeftDistance(int left)

  设置页面边框与页面左边距或纸张左边缘之间的距离（以磅值为默认单位）。

  参数：
    `left` - 页面边框与页面左边距或纸张左边缘之间的距离 说明：set方法的参数默认取磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字）， 可以用 application.util.Utilities.otherToPoint(double, int)方法将其他度量单位转换为磅值后再调用相应的设置方法。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setLeftDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

### setRightDistance

    public void setRightDistance(int right)

  设置页面边框与页面右边距或纸张右边缘之间的距离（以磅值为默认单位）。

  参数：
    `right` - 页面边框与页面右边距或纸张右边缘之间的距离 说明：set方法的参数默认取磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字）， 可以用 application.util.Utilities.otherToPoint(double, int)方法将其他度量单位转换为磅值后再调用相应的设置方法。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setRightDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

### setShowInFront

    public void setShowInFront(boolean flag)

  页面边框总在最前面显示。（即设置“总在前面显示”）

  参数：
    `flag` - 布尔型，如为true，页面边框将总在最前方显示；否则，页面边框不在最前方法显示

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setShowInFront(true);

         doc.setPageBorderAttribute(pageBorderAttr);

### setSurroundFooter

    public void setSurroundFooter(boolean flag)

  将页脚包含在页面边框之内。（即设置“环绕页脚”）
  注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页脚就是使边框的下边距为边框与页脚底边之间的距离。

  参数：
    `flag` - 布尔型，如为true，将页脚包含在页面边框之内；否则，页脚不包含在页面边框之内

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setSurroundFooter(true);

         doc.setPageBorderAttribute(pageBorderAttr);

### setSurroundHeader

    public void setSurroundHeader(boolean flag)

  将页眉包含在页面边框之内。（即设置“环绕页眉”）
  注：必须设置当前的度量依据为正文，边框属性才能设置环绕页眉页脚。 环绕页眉就是使边框的上边距为边框与页眉顶边之间的距离。）

  参数：
    `flag` - 布尔型值，如为true，表示将页眉包含在页面边框之内；否则，页眉不包含在页面边框之内

    例子:

         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setSurroundHeader(true);

         doc.setPageBorderAttribute(pageBorderAttr);

### setTopDistance

    public void setTopDistance(int top)

  设置页面边框与页面上边距或纸张上边缘之间的距离（以磅值为默认单位）。

  参数：
    `top` - 页面边框与页面上边距或纸张上边缘之间的距离 说明：set方法的参数默认取磅值，如果要用其他的度量单位（英寸、厘米、毫米、十二点活字）， 可以用 application.util.Utilities.otherToPoint(double, int)方法将其他度量单位转换为磅值后再调用相应的设置方法。

    例子:

         //请输入一些文字
         Document doc = Application.getWorkbooks().getActiveWorkbook().getDocuments()
              .getActiveDocument();
         PageBorderAttribute pageBorderAttr = doc.getPageBorderAttribute();
         pageBorderAttr.setBorderType(BorderAndShadingConstants.BORDERTYPE_SHADOW);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.TOP, 1);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.LEFT, 3);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.RIGHT, 6);
         pageBorderAttr.setBorderLineType(BorderAndShadingConstants.BOTTOM, 8);

         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.TOP, Color.RED);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.LEFT, Color.CYAN);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.RIGHT, Color.YELLOW);
         pageBorderAttr.setBorderLineColor(BorderAndShadingConstants.BOTTOM, Color.ORANGE);

         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.TOP, 8f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.LEFT, 5f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.RIGHT, 3f);
         pageBorderAttr.setBorderLineWidth(BorderAndShadingConstants.BOTTOM, 1f);

         pageBorderAttr.setTopDistance(1);

         doc.setPageBorderAttribute(pageBorderAttr);

概述 | 软件包 | 类 | 树 | 索引 | 帮助

上一个类 下一个类 | 框架 无框架
摘要： 嵌套 | 字段 | 构造函数 | 方法 | 详细信息： 字段 | 构造函数 | 方法

版权所有 2001-2008 无锡永中科技有限公司