hi maggie, try this code below, i use for HTML object, but you can modify [code] Public Sub sleepWhileNotActive(ByVal t As TObject, w As TIEWindow, Optional TimOut As Integer = 15) ' THTMLEditBox) Dim i As Integer Do While myie.Busy ' ShowPanel ("attesa: " & t.Name) '--per test Pause 1, tpPauseSeconds i = i + 1 If i = TimOut Then Exit Do 'timeout ' panel.Close Loop i = 0 w.Attach 'attach obbligatorio, nel caso ci si dimenticasse 'perde lo schema If t.Exists = False Then Do While t.Exists = False Pause 1, tpPauseSeconds i = i + 1 If i = TimOut Then Exit Do 'timeout Loop End If If t.Exists = False Then Exit Sub 'se ancora non esiste allora esco! darà errore nel chiamante e da li gestisco 't.SetFocus Dim y As Integer Do While t.SetFocus = False Or t.Attach = False ' t.Attach = FalseOr ' showpanel ("attesa: " & t.Name)'--per test Pause 1, tpPauseSeconds ' panel.Close y = y + 1 If y = TimOut Then Exit Do 'timeout Loop ' 'Dim o As Object 'Dim oo As thtmlo 'Set o = Object(t.AttachName, tpAttachWait) End Sub [/code]
↧