title: save and close visio documents visual basic macro
body: <p>I want to create a visio page, add some shapes, store it with a given filename and close it.</p>
  
  <p>Currently, always the object/template toolbar is active and thus stored under the given filename. </p>
  
  <p>What is the best way to store the current drawing?
  thanks</p>
  
  <pre><code>Dim visioApp, visioPage as Object
  Set visioApp = CreateObject("visio.application")
  
  visioApp.Documents.AddEx ("")      
  Set visioPage = visioApp.ActiveWindow.Page
  Set visioStencil = visioApp.Documents.Add("BASFLO_M.VSS")
  
  ' add shapes
  
  visioApp.ActiveDocument.SaveAs ("c:\.......vsd")
  visioApp.ActiveDocument.Close
  </code></pre>