回复 10楼 TonyDeng
再次表示十三亿分感谢

坚守VFP最后的阵地
程序代码:*** XlLineStyle枚举 -- 指定边框的线条样式 * 实线 #DEFINE xlContinuous 1 * 虚线 #DEFINE xlDash -4115 * 点划相间线 #DEFINE xlDashDot 4 * 划线后跟两个点 #DEFINE xlDashDotDot 5 * 点式线 #DEFINE xlDot -4118 * 双线 #DEFINE xlDouble -4119 * 无线条 #DEFINE xlLineStyleNone -4142 * 倾斜的划线 #DEFINE xlSlantDashDot 13 ***

程序代码:
#INCLUDE "Const.h"
*--------------------
* Borders集合:由四个border对象组成的集合,他们分别代表Range或Style对象的四个边框
* 说明:使用Borders属性可返回包含所有四个边框的Borders集合。只能对Range和Style对象的各个边框分别设置
* 边框属性。其他带边框的对象(如误差线和系列线)不论边框有几个边,都将边框视为一个实体。对于这
* 些对象,在返回边框和设置边框属性时必须将其作为一个整体处理。
*
* 使用Borders(index)可返回单个Border对象,其中index指定边框。
* index常量列表:
* xlDiagonalDown = 5 从区域中每个单元格的左上角至右下角的边框
* xlDiagonalUp = 6 从区域中每个单元格的左下角至右上角的边框
* xlEdgeTop = 7 区域左边的边框
* xlEdgeTop = 8 区域顶部的边框
* xlEdgeBottom = 9 区域底部的边框
* xlEdgeRight = 10 区域右边的边框
* xlInsideVertical = 11 区域中所有单元格的垂直边框(区域以外的边框除外)
* xlInsideHorizontal = 12 区域中所有单元格的水平边框(区域以外的边框除外)
*
* Borders.LineStyle属性:返回或设置边框的线型。
* LineStyle取值常量列表:
* xlContinuous = 1 实线
* xlDash = -4115 虚线
* xlDashDot = 4 点划相间线
* xlDashDotDot = 5 划线后跟两个点
* xlDot = -4118 点式线
* xlDouble = -4119 双线
* xlLineStyleNone = -4142 无线条
* xlSlantDashDot = 13 倾斜的划线
*
* Borders.Weight属性:返回或设置一个xlBorderWeight值,它代表边框的粗细。
* Weight常量列表:
* xlHairline = 1 细线(最细的边框)
* xlMedium = -4138 中等
* xlThick = 4 粗(最宽的边框)
* xlThin = 2 细
*
* XlColorIndex枚举:指定所选功能(如边框、字体或填充)的颜色。
* 常量列表:
* xlColorIndexAutomatic = -4105 自动配色
* xlColorIndexNone = -4142 无色
*--------------------
*---------------------
* 画 Excel 表的框格
* 参数:
* o_Excel -- Excel 表对象
* c_LeftTop -- 左上角单元
* c_RightBottom -- 右下角单元
*---------------------
PROCEDURE DrawTableBorder(oExcel AS Object, cLeftTop AS Character, cRightBottom AS Character)
WITH oExcel.ActiveSheet.Range(cLeftTop + ":" + cRightBottom) && 激活指定的单元区域
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
WITH .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
WITH .BorderS(xlEdgeTop)
.Linestyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
.Borders(xlDiagonalDown).LineStyle = xlNone
.Borders(xlDiagonalUp).LineStyle = xlNone
WITH .Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlEdgeTop)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlEdgeRight)
.LineStyle = xlContinuous
.Weight = xlMedium
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlInsideVertical)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
WITH .Borders(xlInsideHorizontal)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
ENDWITH
ENDPROC

程序代码:
WITH .Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.Weight = xlThin
.ColorIndex = xlAutomatic
ENDWITH
