Hi ZadumkinLev-1386,
Please try to add the following code before the while statement loop:
rng.Find.Execute();
while (rng.Find.Found)
{
...
}
More details please refer to this document.
Best Regards,
Daniel Zhang
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.