Michael Williams
asked on
Lotusscript to identify whether or not a File is open
I am able to identify whether or not an application (.exe) is running via Lotusscript.
The following identifies whether an application is running:
Is there a way to identify whether or not a File is open? The file could be a PDF, WK4, WPD etc.
The following identifies whether an application is running:
Dim vObjectService As Variant, vProcessList As Variant
Dim bPS180 As Boolean, bWPWIN18 As Boolean
bPS180 = False
bWPWIN18 = False
Set vObjectService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & "." & "\root\cimv2")
Set vProcessList = vObjectService.ExecQuery("Select * from Win32_Process" )
Forall forProcess In vProcessList
'Process = forProcess.Name
'Process ID = forProcess.ProcessID
'Thread Count = forProcess.ThreadCount
'Page File Size = forProcess.PageFileUsage
'Page Faults = forProcess.PageFaults
'Working Set Size = forProcess.WorkingSetSize
'**** Need to verify ps180.exe & wpwin18.exe processes are running
If (Ucase(forProcess.Name) = "PS180.EXE") Then
bPS180 = True
End If
If (Ucase(forProcess.Name) = "WPWIN18.EXE") Then
bWPWIN18 = True
End If
End Forall
Is there a way to identify whether or not a File is open? The file could be a PDF, WK4, WPD etc.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you for pointing me in the right direction Sjef.