title: c# Detect if file has finished being written
body: <p>I am writing a PowerPoint add-in that FTPs a file that has been converted to a WMV.</p>
  
  <p>I have the following code which works fine:</p>
  
  <pre><code>oPres.CreateVideo(exportName);
  oPres.SaveAs(String.Format(exportPath, exportName),PowerPoint.PpSaveAsFileType.ppSaveAsWMV,MsoTriState.msoCTrue);
  </code></pre>
  
  <p>But this kicks off a process within PP which does the file conversion and it immediately goes to the next line of code before the file has finished being written.</p>
  
  <p>Is there a way to detect when this file has finished being written so I can run the next line of code knowing that the file has been finished?</p>