Trados SDK: how to cleanly remove all the comments in a sdlxliff

We are trying to create an Trados Studio app to remove all the comments in multiple sdlxliff files. We have one particular problem, though.

For a comment applied to a range of text (i.e. a comment whose scope is "Current Selection" as shown in the image below),

we have no problem to remove the comment itself but the highlight of the text always remains as shown in the image below.

Could anybody teach me how to programmatically remove the highlight as well in a proper manner? I would appreciate your help. Thank you.

emoji
Parents Reply Children