Monday, August 19, 2013

How do I kill all open powerpoint process?

How do I kill all open powerpoint process?

I am trying to kill all open powerpoint processes but the code I wrote
kills only one open process.
'-- get a collection of processes running
Dim foo() As System.Diagnostics.Process =
System.Diagnostics.Process.GetProcesses
'-- go through each one looking for the internet explorer name
For Each temp As Diagnostics.Process In foo
'For Word Files opened in Office
If temp.ProcessName = "POWERPNT" Then
temp.Kill() '-- if I find it, kill it.
' Exit For '-- exit the for loop
End If

No comments:

Post a Comment