Keep in mind that you will get an exception if you try to call DeleteAllComments() on a document that doesn't have any comments so it is good to wrap the call in a Globals.ThisDocument.Comments.Count > 0 check, for example:
if (Globals.ThisDocument.Comments.Count > 0)
{
Globals.ThisDocument.DeleteAllComments();
}