UIObject.SaveToFile method (Visio)

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

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

Note

Starting with Visio 2010, the Microsoft Office Fluent user interface (UI) replaced the previous system of layered menus, toolbars, and task panes. VBA objects and members that you used to customize the user interface in previous versions of Visio are still available in Visio, but they function differently.

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

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.