Zhang
in basic i use this function
Function TaskonDesktop(DocPath as String) as Boolean
Dim oComponents as Object
' Search if one of the active Components ist the one that you search for
oComponents = StarDesktop.Components.CreateEnumeration
While oComponents.HasmoreElements
oComponent = oComponents.NextElement
'print UCase(oComponent.URL) & " - " & UCase(converttoURL(DocPath)
If UCase(oComponent.URL) = UCase(converttoURL(DocPath)) then
TaskonDesktop = True
Exit Function
End If
Wend
TaskonDesktop = False
End Function
hope it helps
Fernand