UIObject.SaveToFile Method

Visio Automation Reference

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

Version Information
 Version Added:  Visio 4.0

Syntax

expression.SaveToFile(FileName)

expression   A variable that represents a UIObject object.

Parameters

Name Required/Optional Data Type Description
FileName Required String The name of the file in which to save the UIObject object.

Return Value
Nothing

Remarks

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

ms427934.vs_note(en-us,office.12).gif  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.

Visual Basic for Applications
  
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 = "<em>path\filename.vsu</em>" 
vsoUIObject.SaveToFile (strPath) 
MsgBox ("Menus successfully saved to " &amp; strPath) 

End Sub

See Also