title: Get application ID
body: <p>Do you know how to get applications IDs ("Word.Application" in given example)? What if I will need Excel? Or InDesing?</p>
  
  <pre><code>object word;
  try
  {
      word = System.Runtime.InteropServices.Marshal.GetActiveObject("Word.Application");
  //If there is a running Word instance, it gets saved into the word variable
  }
  catch (COMException)
  {
  //If there is no running instance, it creates a new one
      Type type = Type.GetTypeFromProgID("Word.Application");
      word = System.Activator.CreateInstance(type);
  }
  </code></pre>
  
  <p><a href="https://stackoverflow.com/questions/31361795/find-existing-instance-of-office-application/31361943#31361943">Find existing instance of Office Application</a></p>