To stop Windows Media Encoder, use the following code:
Encoder.Stop Set Encoder = Nothing
Setting the object to Nothing releases it from memory.