Table of contents
Collapse the table of content
Expand the table of content

Document.SaveAs Method (Visio)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Saves a document and gives it a file name.


expression . SaveAs( FileName )

expression A variable that represents a Document object.


NameRequired/OptionalData TypeDescription
FileNameRequiredStringThe file name for the document.

Return Value



The SaveAs method can accept drive names that use the universal naming convention (UNC), for example, \corporation\marketing.

Beginning with Visio 2002, you can save your drawing as an XML drawing (.vdx), an XML stencil (.vsx), or an XML template (.vtx).

If your Visual Studio solution includes the Microsoft.Office.Interop.Visio reference, this method maps to the following types:

  • Microsoft.Office.Interop.Visio.IVDocument.SaveAs(string)


This Microsoft Visual Basic for Applications (VBA) macro shows how to use the SaveAs method. Before running this macro, change path to the location where you want to save the drawing, and change filename to the name you'd like to assign the file.

Public Sub SaveAs_Example()  

    'Use the SaveAs method to save a document for the first time.  
    ThisDocument.SaveAs "path\filename .vsd" 

End Sub
© 2018 Microsoft