title: Update/Replace Shapes in visio diagram programmatically (C#)
body: <p>I would like to programmatically(C#) update/replace all shapes of a given visio flowchart(*.vsd). The diagram layout remain the same(all connections, coordinates etc. are the same), but the master-shapes should be different(from different stencil). 
  Any examples, suggestions and ideas are highly appreciated.</p>
  
  <hr>
  
  <p>Thanks for your suggestions! The source-diagram has many protected shapes that are grouped(+multiple subshapes), so I guess it will be better, if I take all the information for a given source-shape, and then drop a new master from the target-stencil and set these properties. Next, I would take the next Shape and do the same. I would create a new Visio document, since I’m not sure, whether the source Page-ShapeSheet is not customized someway. But I don't know how to do basic steps programmatically in C# e.g.</p>
  
  <ul>
  <li>how to create new vsd file within C# (maybe
  application.Documents.AddEx(“”))</li>
  <li>must I then open this document with application.Document.OpenEx, or the document is already open/active</li>
  <li>must I create a new Page within this document
  -…</li>
  </ul>
  
  <p>In this post: <a href="https://stackoverflow.com/questions/3910309/save-and-close-visio-documents-visual-basic-macro">"save and close visio documents visual basic macro
  "</a> similar steps explained, but in VBA and not in C#.</p>