title: programmatically opening adobe but pdf won't load
body: <p>So I have code to open a pdf programmatically. the code opens adobe reader just fine, but I get a dialog that pops up that says the file doesn't exsit. The problem is though that I can browse to the exact path that is being used to try and open the pdf in a windows explore, plus there is an if statement for if the file exists. So why isn't adobe opening the pdf? </p>
  
  <p>the path for the Adobe .exe on the <code>proc.StartInfo.FileName</code> is correct.</p>
  
  <p>I found this link: <a href="https://visibleprocrastinations.wordpress.com/2009/08/20/there-was-an-error-opening-this-document-file-cannot-be-found-acrobat-reader/" rel="nofollow">https://visibleprocrastinations.wordpress.com/2009/08/20/there-was-an-error-opening-this-document-file-cannot-be-found-acrobat-reader/</a> but I don't know if it still applies</p>
  
  <p>PDF file path: </p>
  
  <p>C:\Users\Printer\SharePoint\Partners - Doc\McG\Labels\TR109897\eLabels_TR109897.pdf</p>
  
  <p>Heres the code I'm using:</p>
  
  <pre><code>Process proc = new Process();
  
  FileInfo file = new FileInfo(filepath);
  
  if (file.Exists)
  {
      //Define Location of adobe reader/command line
      proc.StartInfo.FileName = @"C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe";
      proc.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
      proc.StartInfo.Arguments = string.Format(@"{0}", file.FullName);
      proc.StartInfo.UseShellExecute = true;
      proc.StartInfo.CreateNoWindow = true;
  
      proc.Start();
  
      if (proc.HasExited == false)
          proc.WaitForExit(10000);
  
      proc.Close();
      return true;
  }
  </code></pre>