|
||||
Disse websidene oppdateres ikke lengre og er kun tilgjengelig for historikken sin skyld.Klikk her for å gå til den oppdaterte informasjonen. Kontrollere om et program er tilgjengeligDu kan benytte de to funksjonene nedenfor til å kontrollere om et program allerede kjører eller er tilgjengelig på den PC-en som koden kjøres på: Function ApplicationIsRunning(ApplicationClassName As String) As Boolean
' returnerer True hvis programmet kjører
' eksempel: If Not ApplicationIsRunning("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
On Error Resume Next
Set AnyApp = GetObject(, ApplicationClassName)
ApplicationIsRunning = Not AnyApp Is Nothing
Set AnyApp = Nothing
On Error GoTo 0
End Function
Function ApplicationIsAvailable(ApplicationClassName As String) As Boolean
' returnerer True hvis programmet er tilgjengelig
' eksempel: If Not ApplicationIsAvailable("Outlook.Application") Then Exit Sub
Dim AnyApp As Object
On Error Resume Next
Set AnyApp = CreateObject(ApplicationClassName)
ApplicationIsAvailable = Not AnyApp Is Nothing
Set AnyApp = Nothing
On Error GoTo 0
End Function
Dokumentet er sist oppdatert 2000-04-12 12:35:01
|
||||
| ||||