ExcelScript.ConditionalRangeFont interface
Esse objeto representa os atributos da fonte (estilo da fonte, cor etc.) para um objeto.
Comentários
Usada por
Exemplos
/**
* This script applies cell value conditional formatting to a range.
* Any value less than 60 will have the cell's fill color changed and the font made italic.
*/
function main(workbook: ExcelScript.Workbook) {
// Get the range to format.
const selectedRange = workbook.getSelectedRange();
// Add cell value conditional formatting.
const cellValueConditionalFormatting =
selectedRange.addConditionalFormat(ExcelScript.ConditionalFormatType.cellValue).getCellValue();
// Create the condition, in this case when the cell value is less than 60.
const rule: ExcelScript.ConditionalCellValueRule = {
formula1: "60",
operator: ExcelScript.ConditionalCellValueOperator.lessThan
};
cellValueConditionalFormatting.setRule(rule);
// Set the format to apply when the condition is met.
const format: ExcelScript.ConditionalRangeFormat = cellValueConditionalFormatting.getFormat();
const fill: ExcelScript.ConditionalRangeFill = format.getFill();
const font: ExcelScript.ConditionalRangeFont = format.getFont();
fill.setColor("yellow");
font.setItalic(true);
}
Métodos
| clear() | Redefine os formatos de fonte. |
| get |
Especifica se a fonte está em negrito. |
| get |
Representação da cor do texto no código de cores HTML (por exemplo, #FF0000 representa vermelho). |
| get |
Especifica se a fonte está em itálico. |
| get |
Especifica o status tachado da fonte. |
| get |
O tipo de sublinhado aplicado à fonte. Consulte |
| set |
Especifica se a fonte está em negrito. |
| set |
Representação da cor do texto no código de cores HTML (por exemplo, #FF0000 representa vermelho). |
| set |
Especifica se a fonte está em itálico. |
| set |
Especifica o status tachado da fonte. |
| set |
O tipo de sublinhado aplicado à fonte. Consulte |
Detalhes do método
clear()
Redefine os formatos de fonte.
clear(): void;
Retornos
void
getBold()
Especifica se a fonte está em negrito.
getBold(): boolean;
Retornos
boolean
getColor()
Representação da cor do texto no código de cores HTML (por exemplo, #FF0000 representa vermelho).
getColor(): string;
Retornos
string
getItalic()
Especifica se a fonte está em itálico.
getItalic(): boolean;
Retornos
boolean
getStrikethrough()
Especifica o status tachado da fonte.
getStrikethrough(): boolean;
Retornos
boolean
getUnderline()
O tipo de sublinhado aplicado à fonte. Consulte ExcelScript.ConditionalRangeFontUnderlineStyle para obter detalhes.
getUnderline(): ConditionalRangeFontUnderlineStyle;
Retornos
setBold(bold)
Especifica se a fonte está em negrito.
setBold(bold: boolean): void;
Parâmetros
- bold
-
boolean
Retornos
void
setColor(color)
Representação da cor do texto no código de cores HTML (por exemplo, #FF0000 representa vermelho).
setColor(color: string): void;
Parâmetros
- color
-
string
Retornos
void
setItalic(italic)
Especifica se a fonte está em itálico.
setItalic(italic: boolean): void;
Parâmetros
- italic
-
boolean
Retornos
void
setStrikethrough(strikethrough)
Especifica o status tachado da fonte.
setStrikethrough(strikethrough: boolean): void;
Parâmetros
- strikethrough
-
boolean
Retornos
void
setUnderline(underline)
O tipo de sublinhado aplicado à fonte. Consulte ExcelScript.ConditionalRangeFontUnderlineStyle para obter detalhes.
setUnderline(underline: ConditionalRangeFontUnderlineStyle): void;
Parâmetros
Retornos
void