title: Close specific pdf files
body: <p>I use this function to close adobe reader</p>
  
  <pre><code>Sub TerminateProcess()
  Dim strTerminateThis As String
  Dim objWMIcimv2 As Object
  Dim objProcess As Object
  Dim objList As Object
  Dim intError As Integer
  
  'Process to terminate
  strTerminateThis = "AcroRd32.exe"
  
  'Connect to CIMV2 Namespace
  Set objWMIcimv2 = GetObject("winmgmts:" &amp; "{impersonationLevel=impersonate}!\\.\root\cimv2")
  
  'Find the process to terminate
  Set objList = objWMIcimv2.ExecQuery("select * from win32_process where name='" &amp; strTerminateThis &amp; "'")
  
  'Terminates a process and all of its threads.
  For Each objProcess In objList
      intError = objProcess.Terminate
  Next
  
  Set objWMIcimv2 = Nothing
  Set objList = Nothing
  Set objProcess = Nothing
  End Sub
  </code></pre>
  
  <p>Is it possible to edit it so I can close specific pdf files and not all files?</p>
  
  <p>Thank u in advance.</p>