How to copy text from MS word with saving all parameters (font, paragraph, underline, etc.)

Good day everyone!
Faced a problem at monitoring of the folder on existence of the file, I will explain. The program should check the folder for as long as there does not appear any file no matter.
The problem is this: the program checks the folder, but it freezes when the file folder appears.
Here is my code:
The condition is checked, the output argument of the workflow search_file


The program outputs yes and hangs Studio, or program

Thanks!

My guess is it going in a infinite loop, share the workflow too.

That is because you have used break inside your for each, it will go just after your condition is true it will break the flow, and then it will go for either writeline or message box, if it is going to write line then it will become infinite loop.

Then what is the best way to do it?