Unfortunately, as of Visio 2013, Visio does not allow you to assign custom keyboard shortcuts.
Note: After further review, the following workaround does not help, since the shortcut key only works in the Visio file that has the macro saved in it.
One workaround for this is to record a macro and assign a keyboard shortcut to the macro when recording it. So let's say we want to use CTRL+u for ungrouping shapes in addition to the default CTRL+SHIFT+u. You can record a macro ungrouping some grouped items and assign the CTRL+u keyboard shortcut to the macro when recording it. After recording the macro, edit the macro and delete all the lines except for the lines below. If the selected shapes are not grouped, running this macro would cause an error. So add "On Error Resume Next" to cause the error to be ignored.
Sub Ungroup()
On Error Resume Next
ActiveWindow.Selection.Ungroup
End Sub
However, when you record a macro it is saved in one specific Visio file and the keyboard shortcut will only work when that file is open. In Word, you can simply save your favorite macros in a Word file and place the file in Word's Start-up folder. Unfortunately, you cannot open a Visio file (.vsd) or Visio template (.vst) by copying it to Visio's Start-up; only EXE or DLL files work in the Start-up folder.
In order to have the Visio load the file that contains your macro and keyboard shortcut when Visio starts, do the following:
- Install AutoIt.
Write an AutoIt file with one line that opens the Visio file that contains your macros. The file must be a text file with a .au3 extension.
Here is an example of the one line:
Run ("C:\Program Files (x86)\Microsoft Office\Office14\VISIO.EXE C:\Visio Templates\MyMacros.vsd")
The above Run command has one parameter. This parameter contains the path to the Visio program followed by a space, followed by the path to the Visio file that you want to open.
Close the AutoIt file.
- Right-click on the file and select Compile Script. An EXE file is created.
- Define a Start-up folder location in Visio (File>Options>Advanced>File Locations). Make sure there are no spaces in the path of the Start-up folder.
- Copy the EXE file to the Start-up folder. Note that only the EXE file must be in the Start-up folder. The Visio file that your opening can be anywhere on the computer.
Now every time you open Visio, Visio will run the EXE, which will open the Visio file containing your macros.