Share via


SaveToFile Method [Visio 2003 SDK Documentation]

Saves the user interface represented by a UIObject object in a file.

object**.SaveToFile** (FileName)

object     Required. An expression that returns the UIObject object to save to the file.

FileName     Required String. The name of the file in which to save the UIObject object.

Version added

4.0

Remarks

The file can be loaded into the application by using the LoadFromFile method of a UIObject object.

Note   Beginning with Visio 2000, you can customize the user interface by right-clicking the toolbar and then clicking Customize on the shortcut menu. Changes you make to the interface persist when you close the application—they are stored with the Application object and in a file named Custom.vsu, which is stored as Application Data in the current user's User Profile.

Example

This Microsoft Visual Basic for Applications (VBA) macro shows how to save a custom user interface file (.vsu). It does not manipulate any Visio menus or menu items. Before running this macro, change path to the location where you want to save the file, and change filename to the name you'd like to assign the file.

Public Sub SaveMenusToFile_Example() 

    Dim vsoUIObject As Visio.UIObject 
    Dim strPath As String 

    'Get the Menus object from Visio. 
    Set vsoUIObject = Visio.Application.BuiltInMenus 

    'Save the Menus object to a file. 
    strPath = "path\filename.vsu" 
    vsoUIObject.SaveToFile (strPath) 
    MsgBox ("Menus successfully saved to " & strPath) 

End Sub  

Applies to | UIObject object

See Also | LoadFromFile method