Sets the per-edge border color to one of the 12 Office theme color slots with an optional tint. Theme companion of
Border.Color. Available on every edge selector (top, bottom, left, right, diagonal, plus the compound selectors xlAround, xlInsideVertical, xlInsideHorizontal, xlInsideAll). Available since v2.61.0; the compound selector path was completed in v2.63.0 (wave D phase 6).
Syntax
procedure SetThemeColor(ThemeIdx: Word; Tint: Double);
Parameters
ThemeIdx — 0-based theme slot
(0=lt1, 1=dk1, 2=lt2, 3=dk2, 4..9=accent1..6, 10=hlink, 11=foHlink).
Tint — spec-style lighter/darker adjustment in the range -1.0 .. +1.0.
Encoded into the XFExt FullColorExt as a Q15 signed integer in nTintShade.
Remarks
Same dual-wire emission as the Interior / Font setters:
- The XF record gets a best-match indexed icv on the matching edge slot for Excel 97-2003 compatibility.
- The XFExt $087D record gets a FullColorExt slot for the matching border extType ($0007 top, $0008 bottom, $0009 left, $000A right, $000B diagonal) with
xclrType=3 and xclrValue=ThemeIdx.
Compound selectors register one XFExt slot per physical edge in a single cell-loop pass via the internal slot-set helper.
xlAround registers
{rsTop, rsBottom, rsLeft, rsRight};
xlInsideVertical registers
{rsLeft, rsRight};
xlInsideHorizontal registers
{rsTop, rsBottom};
xlInsideAll registers all four. Read-back through
Border.Color returns the resolved RGB.
BIFF8 FullColorExt only carries a single diagonal color, so xlDiagonalDown and xlDiagonalUp share the same XFExt slot (rsDiag).
Example
Outlines a report band with accent4 (theme color) and adds an inner accent5 separator with a 25% lighter tint.
var
Report: IXLSRange;
begin
Report := Workbook.Sheets[1].Range['A1', 'F20'];
Report.Borders[xlAround].SetThemeColor(7, 0.0);
Report.Borders[xlInsideHorizontal].SetThemeColor(8, 0.25);
Workbook.SaveAs('ThemedBorders.xls', xlExcel97);
end;
See also