I have a webedit object that when you click inside of it a list is displayed of possible choices. Clicking on an item in the list will place that item into the webedit text field. My issue is that after QTP clicks into the webedit text box and displays the list focus returns to QTP and the list closes, thus when QTP tries to click on the item within the list an error occurs because the object is not there.
Just to be clear - this behavior is very much expected to happen when you step through your script as you mention in your second post. Stepping will always return focus to QTP after each line of your script is executed (if it didn't, you would have no way to take the next step).
But actually running the script should never return focus to QTP. If it did, then all those .SetFocus methods would be pretty pointless, and you would never be able to do things like .Set("somevalue") on one line then .Type micTab on the next line to enter data into a field then follow it with a TAB key. Or lots of other stuff that wouldn't work either.
So are you seeing the problem occur if you remove all your break points and just let the script run without any breaks or steps?
If you believe you are, my insticnt says that the focus is remaining on your test application but something else is going wrong - and when that goes wrong, whatever it is, QTP fails to handle something in your script and then after this stuff goes wrong, QTP gets the focus back so it can tell you something went wrong.
In other words, it's probably the error that causes the change of focus to QTP, and it's probably not a change of focus to QTP that's causing the error.