Word.CommentDetail interface

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

A structure for the ID and reply IDs of this comment.

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

Examples

// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/word/99-preview-apis/manage-comments.yaml

// Registers event handlers.
await Word.run(async (context) => {
  const body: Word.Body = context.document.body;
  body.track();
  await context.sync();

  eventContexts[0] = body.onCommentAdded.add(onEventHandler);
  eventContexts[1] = body.onCommentChanged.add(onChangedHandler);
  eventContexts[2] = body.onCommentDeleted.add(onEventHandler);
  eventContexts[3] = body.onCommentDeselected.add(onEventHandler);
  eventContexts[4] = body.onCommentSelected.add(onEventHandler);
  await context.sync();

  console.log("Event handlers registered.");
});

...

async function onEventHandler(event: Word.CommentEventArgs) {
  // Handler for all events except onCommentChanged.
  await Word.run(async (context) => {
    console.log(`${event.type} event detected. Event source: ${event.source}. Comment info:`, event.commentDetails);
  });
}

Properties

id

Represents the ID of this comment.

replyIds

Represents the IDs of the replies to this comment.

Property Details

id

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents the ID of this comment.

id: string;

Property Value

string

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]

replyIds

Note

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Represents the IDs of the replies to this comment.

replyIds: string[];

Property Value

string[]

Remarks

[ API set: WordApi BETA (PREVIEW ONLY) ]