How do delete selected messages from ClientState.SelectedMessage?

Below is some sample code which isn't working

Set SelMsgs = g_C3POManager.ClientState.SelectedMessages
do while SelMsgs.Count<>0

...processing

SelMsgs.Remove 1
wend

Thanks

Phil.