Vassili,
So the data session doesn't hang if the loop only executes once, but does hang if the loop executes more than once?
What happens if you:
loMyRange = THIS.oDoc.Content
DO WHILE loMyRange.Find.Execute ("@@", , , , , , , , , "", 1)
loMyRange.Delete(1,MarkerLength)
loMyRange.InsertAfter( DataToBeInserted)
loMyRange = .null.
loMyRange = THIS.oDoc.Content
ENDDO
loMyRange = .null.
Something else to lookout for is using FOR EACH those can cause internal dangling references.
And like Nadya suggests you should set
this.oDoc = .null. at some point in your destruct sequence.
>There is no difference how to close Word and no Winword process in the Task Manager.
>But I note that the problem does not appear if only one piece of Word document to be replaced in loop:
>
>loMyRange = THIS.oDoc.Content
>
>DO WHILE loMyRange.Find.Execute ("@@", , , , , , , , , "", 1)
> loMyRange.Delete(1,MarkerLength)
> loMyRange.InsertAfter( DataToBeInserted)
> loMyRange = THIS.oDoc.Content
>ENDDO