Excel.CommentChangedEventArgs interface
Se produce cuando se cambian los comentarios existentes.
Comentarios
[ Conjunto de API: ExcelApi 1.12 ]
Ejemplos
async function registerEventHandler() {
await Excel.run(async (context) => {
// Register the onChanged comment event handler.
const comments = context.workbook.worksheets.getActiveWorksheet().comments;
comments.onChanged.add(commentChanged);
await context.sync();
});
}
async function commentChanged(event: Excel.CommentChangedEventArgs) {
// Retrieve the changed comment using the comment ID.
// Note: This function assumes only a single comment is changed at a time.
await Excel.run(async (context) => {
const changedComment = context.workbook.comments.getItem(event.commentDetails[0].commentId);
// Load the changed comment's data.
changedComment.load(["content", "authorName", "creationDate"]);
await context.sync();
// Print out the changed comment's data.
console.log(`A comment was changed:`);
console.log(` ID: ${event.commentDetails[0].commentId}`);
console.log(` Updated comment content: ${changedComment.content}`);
console.log(` Comment author: ${changedComment.authorName}`);
console.log(` Creation date: ${changedComment.creationDate}`);
});
}
Propiedades
| change |
Obtiene el tipo de cambio que representa cómo se desencadena el evento modificado. |
| comment |
Obtenga la |
| source | Especifica el origen del evento. Vea |
| type | Obtiene el tipo del evento. Vea |
| worksheet |
Obtiene el identificador de la hoja de cálculo en la que se produjo el evento. |
Detalles de las propiedades
changeType
Obtiene el tipo de cambio que representa cómo se desencadena el evento modificado.
changeType: Excel.CommentChangeType | "CommentEdited" | "CommentResolved" | "CommentReopened" | "ReplyAdded" | "ReplyDeleted" | "ReplyEdited";
Valor de propiedad
Excel.CommentChangeType | "CommentEdited" | "CommentResolved" | "CommentReopened" | "ReplyAdded" | "ReplyDeleted" | "ReplyEdited"
Comentarios
commentDetails
Obtenga la CommentDetail matriz que contiene el identificador de comentario y los identificadores de sus respuestas relacionadas.
commentDetails: Excel.CommentDetail[];
Valor de propiedad
Comentarios
source
Especifica el origen del evento. Vea Excel.EventSource para más información.
source: Excel.EventSource | "Local" | "Remote";
Valor de propiedad
Excel.EventSource | "Local" | "Remote"
Comentarios
type
Obtiene el tipo del evento. Vea Excel.EventType para más información.
type: "CommentChanged";
Valor de propiedad
"CommentChanged"
Comentarios
worksheetId
Obtiene el identificador de la hoja de cálculo en la que se produjo el evento.
worksheetId: string;
Valor de propiedad
string