Recorder considerations The macro recorder can be used to record actions taken when using the Visio user interface. These actions are recorded as VBA code. Executing the resulting code should repeat the action. More generally, the macro recorder is a great tool for learning how the Visio object model works and for putting together small pieces of code that can later be cleaned up and repackaged into useful tools. The final form of the code generated by the recorder may even find itself into code developed in Visual Studio or some other development environment. Although it will necessarily have to be reformatted, that is not usually a big deal. The important thing is that it makes learning to automate Visio very discoverable for most things – anyway. Unfortunately there are some areas where the macro recorder for Visio 2007 has limited use. The API programmability model for Themes, Data Graphics, and Pivot diagrams does not cover everything that can be done in the user interface so use of the macro recorder in these areas has been short circuited. This doesn’t mean that you cannot automate these features. It just means you have to learn to do it the old fashioned way, by slogging through the object model, reading, and asking questions, instead of being able to get a nice little code fragment generated for you automatically. Themes When the macro recorder is turned Edit, Duplicate, and Delete are disabled in the Themes task pane. Data Graphics If the Data Graphics task pane is open and the recorder is turned on, the task pane is closed. The Display Data on Shapes menu is disabled and the task pane cannot be reopened macro recording turned off.
Recorder considerations The macro recorder can be used to record actions taken when using the Visio user interface. These actions are recorded as VBA code. Executing the resulting code should repeat the action. More generally, the macro recorder is a great tool for learning how the Visio object model works and for putting together small pieces of code that can later be cleaned up and repackaged into useful tools. The final form of the code generated by the recorder may even find itself into code developed in Visual Studio or some other development environment. Although it will necessarily have to be reformatted, that is not usually a big deal. The important thing is that it makes learning to automate Visio very discoverable – for most things anyway. Unfortunately there are some areas where the macro recorder for Visio 2007 has limited use. The API programmability model for Themes, Data Graphics, and Pivot diagrams does not cover everything that can be done in the user interface so use of the macro recorder in these areas has been short circuited. This doesn’t mean that you cannot automate these features. It just means you have to learn to do it the old fashioned way, by slogging through the object model, reading, and asking questions, instead of being able to get a nice little code fragment generated for you automatically. Themes When the macro recorder is turned Edit, Duplicate, and Delete are disabled in the Themes task pane. Data Graphics If the Data Graphics task pane is open and the recorder is turned on, the task pane is closed. The Display Data on Shapes menu is disabled and the task pane cannot be reopened macro recording turned off.
Visio%202010%20Developer%20Training%2002%20-%20Solutions%20and%20Publishing.docx