Link Search Menu Expand Document

SSpread.GetCellBorder Method

Explanation Gets the color and line type of the border around the cell.
Use the SetCellBorder method to set the cell border.
Call format GetCellBorder(col, row, index)
Return value Record object with the following child objects
Type Name Description
Number
UString
Color Border color
Able to get the color constant or #RRGGBB format
Number Style Line type
Returns the following values:
Constant Value Description
$CellBorderStyleDefault 0 No borders (display default grid)
$CellBorderStyleSolid 1 Solid line
$CellBorderStyleDash 2 Dashed line
$CellBorderStyleDot 3 Dotted line
$CellBorderStyleDashDot 4 Dash dotted line
$CellBorderStyleDashDotDot 5 Dash double-dotted line
$CellBorderStyleBlank 6 Erase ruled lines and grid lines
$CellBorderStyleFineSolid 11 Line with every other dot
$CellBorderStyleFineDash 12 Fine dashed line
$CellBorderStyleFineDot 13 Fine dotted line
$CellBorderStyleFineDashDot 14 Fine dash dotted line
$CellBorderStyleFineDashDotDot 15 Fine dash double-dotted line
Arguments col Cell column number
row Cell row number
index Ruled line part to be acquired
Specify the following values.
Constant Value Description
$CellBorderIndexLeft 1 Left border of cell
$ CellBorderIndexRight 2 Right border of cell
$CellBorderIndexTop 4 Cell top border
$CellBorderIndexBottom 8 Bottom border of cell
$CellBorderIndexOutline 16 Outer frame of cell range
Exception None
Example of use
    var ret = GetCellBorder(1, 1, $CellBorderIndexLeft);
    var style = "";
    switch (ret.Style){
        case $CellBorderStyleDefault:
            style = "No ruled lines";
            break;
        case $CellBorderStyleSolid:
            style = "Solid line";
            break;
        default:
            style = "Others";
            break;
    }
    MessageBox("The ruled line on the left side of (1, 1)「" + style + "」で、colour is" + str(ret.Color));
    
Related item SetCellBorder method