Function SetBorderRange(sheet:variant;range:string;
Edge,LineStyle,Weight,ColorIndex,Color:integer):boolean;
begin
SetBorderRange:=true;
try
E.ActiveWorkbook.Sheets.Item[sheet].Range[range].Borders.item
[Edge].Weight:=Weight;
E.ActiveWorkbook.Sheets.Item[sheet].Range[range].Borders.item
[Edge].LineStyle:=LineStyle;
if ColorIndex>0
then
E.ActiveWorkbook.Sheets.Item[sheet].Range[range].Borders.item
[Edge].ColorIndex:=ColorIndex
else
E.ActiveWorkbook.Sheets.Item[sheet].Range[range].Borders.item
[Edge].Color:=color;
except
SetBorderRange:=false;
end;
End;
|