How can I merge some commands to recover by once

I use C# to control coreldraw that code contains for loop

then I will click recovery button 

It will recover my commands step by step

How can I merge some commands to recover by once