title: Execute Routine After Save
body: <p>I need to execute a function in Visio after saving the document.<br />
  VBA for Visio has the following function for execution after save</p>
  <pre class="lang-vb prettyprint-override"><code>Private Sub Document_DocumentSaved(ByVal doc As IVDocument)
      'Function Code
  End Sub
  </code></pre>
  <p>However, this function does not execute after the save is finished, but before. I can verify this by the date of the Visio file and the Microsoft Office Upload Center, which does not start before the VBA code finished executing. (The VBA code in question is used for stuff relating to SharePoint and it is essential that the file is saved before executing the actions.)</p>
  <p>One possible workaround is <code>Application.OnTime</code>. This function could be used before save to schedule the execution of the code after save is completed. Unfortunately, <code>Appication.OnTime</code> is not available in VBA for Visio.</p>