Microsoft Visio Version 2002 Inside Out (Inside Out (Microsoft))
3 4
When you create or customize a template, you set up a reusable environment that includes one or more drawing pages, the page settings you require, and the stencils that you want to make available. The simplest way to create a template with custom settings is to open a drawing, choose the page settings and stencils you want, and then save everything as a template (.vst) file. It's no more complicated than that.
Most Visio templates open with a blank drawing page, but you can create a template that already includes shapes. For example, you can save a border and title block on the drawing page and then save the drawing as a template. Or you can add your company logo to a background page and then save the file as a template so that the logo will appear on each page of a diagram created with that template, as Figure 21-16 shows. People typically create their own templates when they want a convenient way of opening several frequently used stencils together, or when they want to save custom page settings and window positions.
Figure 21-16. You can save the settings and shapes you use most as a reusable template.
You can save any Visio file as a template. When you save the file, you're also saving the file's page settings, print settings, style definitions, VBA macros, color palette, layers, window sizes and positions, and snap and glue options. Make sure to specify the options you want in your template, because those are the options that will appear as the defaults in any diagram based on that template.
If you save your template file in one of the Solutions folders, it will appear with other templates when you start Visio, as Figure 21-17 shows. The template is also listed when you click the New button on the Standard toolbar or use the New command on the File menu. The default location to which Visio installs template files is C:\Program Files \Microsoft Office\Visio10\1033\Solutions, but you can specify other paths with the Options command (choose Tools, Options, and then click the File Paths tab).
Figure 21-17. When you save a template in one of Visio's Solutions folders, the template appears as an option when you start Visio. Visio creates a default preview image.
To create a template from a drawing file or an existing template, follow these steps:
- Open a drawing (.vsd) file, or start a new drawing based on the template you want to modify.
- Open the stencils you want to save with the template.
- Insert pages, if you want, and specify the drawing page settings you want to use in all diagrams based on this template.
For example, choose File, Page Setup to specify the page size and drawing scale.
- If you want the template to include open windows automatically, display the windows you want.
For example, choose View, Pan & Zoom Window to have the Pan & Zoom window open every time you start a drawing with the template.
- When you've added the settings you want, choose File, Save As.
- In the Save As Type list, select Template (*.vst).
- Type a file name for your template and specify a location.
- Click the Save button's drop-down arrow, and verify that the settings you want are selected.
By default, Workspace is selected, which means that Visio saves the size and position of all the open windows with the file's other contents. The Read Only option isn't necessary unless you really don't want anyone to be able to open the original template file—an error will appear if you try to open the original version of a template saved as read-only.
- Click Save to create the template file in the specified location.
Adding Stencils to a Template
Your template can include stencils that Visio opens in the default fashion: as docked windows in the Shapes area of the Visio window. However, if you prefer working with stencils in a different location, or with some stencils docked and others floating, you can do this in your template, as Figure 21-18 shows. When you're creating your template, all you have to do is arrange the stencils in the way you want them to open. As long as you save the template file and its workspace list (the default behavior when you save), the stencils will open as specified when you start a drawing based on your template.
If you're saving stencil and template files that are meant to work together, make sure that their styles and colors are compatible. Because stencils are separate Visio files that the template file opens, Visio's inheritance rules apply when shapes are dragged between files. Odd complications can arise if you've used a color theme or styles for your masters that are different from the settings in your template. Recall that the style and color settings are saved with the file, so for masters, that means the settings are saved with the stencil file. The template file can have different settings that can override those specified by the stencil.
For example, if a master shape is formatted with a custom style, that style is saved with the stencil file. If you include that stencil file in a template, but the template doesn't include the same style, Visio adds the style to the template when the master is added to the drawing page. No problem. But what if the template file also has a style of the same name? Perhaps the Normal style in the stencil file specifies 8-point Arial type and the Normal style in the template file specifies 12-point Arial type. When you add the shape, the style will inherit the characteristics of the style from the drawing page, which inherited the template's settings.
Figure 21-18. Visio saves the position and size of the open windows in your template as part of the file's workspace list.
For details about how styles are inherited, see "Copying Styles and Color Schemes to Other Diagrams."
Creating Templates for Scaled Drawings
If you are creating a template for scaled drawings, such as a floor plan, the page scale is set by the template's drawing page. The scale at which the shape is drawn determines the master scale. It's possible to create master shapes at one drawing scale and save them with a template that specifies a different drawing scale. As long as the scales are fairly close (specifically, no more than eight times larger or smaller), you won't have a problem using the shapes on that page.
You specify the drawing scale for masters the same way you do for templates: Use the Page Setup command on the File menu, and then click the Drawing Scale tab. The difference is that if you're editing a master, you're probably working on the master drawing page. If you're specifying a template's settings, you're probably working on the template's drawing page.
For details about drawing scales, see "Working with a Drawing Scale." Chapter 16 also provides information about other options you may want to include in a scaled template, such as a variable grid, guide lines, and useful snap settings.