Mastering Visio Documents

3 4

Behind every shape, template, and solution in Visio is a file format that makes customization possible. If you want to create your own masters and stencils, or customize templates for others or just yourself, you need to understand this fundamental fact of Visio life: All Visio files have the same format, and that format includes a drawing page and a stencil. That is, every drawing page has a stencil, and every stencil has a drawing page. The file name extension determines what you see when you open a file, which is why when you open a stencil (.vss) file, you typically don't see the drawing page, or when you open a blank drawing (.vsd) file, you don't see a stencil.

Here's a little experiment you can try to see how this works:

  1. Start Visio.
  2. If Visio is already running, save any changes, and close all open Visio documents.
  3. Choose File, New, New Drawing.

    Visio opens a blank drawing page and no stencils.

  4. Choose File, Stencils, Document Stencil.

    Visio opens a blank stencil, as Figure 21-1 shows.

    figure 21-1.  a visio file includes a drawing page and a document stencil. the file name extension determines whether visio opens both a drawing page window and a stencil window.

    Figure 21-1.  A Visio file includes a drawing page and a document stencil. The file name extension determines whether Visio opens both a drawing page window and a stencil window.

Why is this important? The fact that a Visio file has both a drawing page and a stencil has all kinds of ramifications that can help you work with shapes more efficiently and keep file size down when you customize stencils and templates. Visio uses the document stencil to store copies of any masters added to that drawing file. Shapes on the drawing page are instances of the masters on the document stencil. One convenient side effect of the relationship between shapes on the page and masters on the document stencil is that you can edit masters on a document stencil, and the change will affect all the copies of the master in that drawing file.

If a Visio file always contains a drawing page and a stencil, why are there different types of files? You can open and save Visio files with the following file name extensions:

  • Drawing (.vsd)
  • Stencil (.vss)
  • Template (.vst)

The Visio engine uses the file name extension to determine what to display on the screen when the document is opened—that is, which windows should be active. You can save a Visio file using any other Visio file name extension to change what appears when the file is opened. For example, you can save a drawing file (.vsd) as a template (.vst), which you can then open and work with as a template. The sections that follow describe what happens when you open each file type.

Note


Visio recognizes other file name extensions as well. A Visio report definition is saved as a file with the .vrd extension, but can be read only by the Reporting tool (Tools, Report). A .vdx, .vsx, or .vtx file is a Visio drawing, stencil, or template saved in XML format. For details, see "Visio and XML File Formats."


Troubleshooting

The option to open a file as an original or copy, or as read-only, seems to be missing.

In previous versions of Visio, the Open dialog box included check boxes for opening a file as an original, copy, or read-only version. Those options still exist; they're just harder to find. In the Open dialog box, click the drop-down arrow on the Open button to display a menu. Choose the option you want, and then click the Open button again to open the selected file as specified.


Opening Drawing (.vsd) Files

In Microsoft Office–speak, a "document" is the generic term for a Word file or the thing you create when you press Ctrl+N. The equivalent generic term in Visio is drawing file, which has the .vsd file name extension. When you click the New button on the Standard toolbar, or press Ctrl+N in Visio, you create a drawing file. When you open an existing drawing file, Visio opens all the windows and files that were open when the file was last saved. Visio maintains an internal workspace list that saves this information. Typically, a drawing file displays only the drawing page window; its document stencil window is closed. To display the document stencil, choose File, Stencils, Document Stencil.

Each Visio drawing file always has at least one drawing page, a document stencil, and a workspace list. A drawing file's document stencil contains copies of any masters used on the drawing page. In addition, a drawing file always includes the five default Visio styles (Guide, No Style, None, Normal, and Text Only), a color palette, a default VBA project with an empty class module called ThisDocument, and a document sheet (that is, a ShapeSheet for the document) that can store user-defined data.

That is the minimum list of contents for a drawing file. You can customize the file's color palette and style lists, and those changes will be saved with the file, as will be any VBA projects, with their own modules, class modules, and user forms.

InsideOut


If you're a veteran Visio user, you might recognize that the Document Stencil command used to be the Show Master Shapes command. The name was changed in Visio 2000 in the hope that more users would discover this useful method of displaying and editing the masters and shapes in a diagram.

Opening Files That Contain Macros

Although this book doesn't delve much into VBA, be aware that VBA projects are part of a drawing file. When you open a drawing file that includes VBA or other project code, as some of the sample files do, you'll see the message shown in Figure 21-2. This message is a new safeguard feature of Visio. Despite the dire tone of the message, you probably want to click Enable Macros if you know the source of the drawing file. The macros are most likely used to provide functionality within the drawing, such as adding a control, menu, or special command.

figure 21-2.  when you open a drawing file that includes a vba macro or other programming code, visio displays this message to warn you about its contents. usually the macros are needed to enable interactive features of the drawing.

Figure 21-2.  When you open a drawing file that includes a VBA macro or other programming code, Visio displays this message to warn you about its contents. Usually the macros are needed to enable interactive features of the drawing.

You can prevent this message by lowering the security settings for Visio, which generally is not a good idea unless you have virus-scanning software installed on your computer. To do this, choose Tools, Macros, Security. On the Security Level tab of the Security dialog box, click the Low option, and then click OK.

Opening Stencil (.vss) Files

A Visio file with the .vss extension is sometimes referred to as a standalone stencil to differentiate it from a document stencil. A standalone stencil can be opened by itself or with a template. When you open a stencil file, Visio's default behavior is to open it as read-only in a docked window, if a drawing window is active. If a drawing window is not active—that is, you're opening the stencil by itself—the Visio engine creates a stencil window and displays the file's stencil. The stencil's drawing page is closed, but you can display it by choosing Window, Show Drawing Page.

To open a standalone stencil file so that you can edit it, you need to specify whether you want to open the original or a copy of the stencil, as Figure 21-3 shows. To open a stencil for editing, it's quickest to choose File, Stencils, Open Stencil, because Visio then displays the stencil folders (or the stencil path you've specified on the File Paths tab of the Options dialog box).

Note


If the title bar of a stencil window displays the file name in curly brackets—for example, {Stencil Name}—the stencil is read-only, and you cannot edit it or the masters in it.

An original or copy of a stencil file is displayed in a stencil window as opposed to a dockable stencil pane. When a stencil window is active (you make a window active by clicking its title bar), Visio adds the Master menu, which contains commands for editing masters and master icons. The reason a stencil file needs a drawing page is that the page stores the drawing scale, styles, and other settings used in the document. You can add or edit the masters on a standalone stencil, which is an efficient way to edit a shape you use frequently. When you next open a Visio drawing or template file that includes the stencil, you can use the revised master.

figure 21-3.  when you open a stencil, visio opens it as read-only unless you specify otherwise in the open stencil dialog box.

Figure 21-3.  When you open a stencil, Visio opens it as read-only unless you specify otherwise in the Open Stencil dialog box.

Tip


To display a list of all the items in a stencil file, choose View, Drawing Explorer Window.

If you're working in a drawing that includes docked standalone stencils, and you want to open one for editing, you can right-click its title bar, and then choose Edit. When a docked stencil is open for editing, its title bar displays a red asterisk, as Figure 21-4 shows. You won't see the Master menu, but you can access the same commands by right-clicking a green area in the stencil.

Note


You cannot open an original stencil if a read-only copy of that stencil is open already. Close the read-only copy, and then open the original.

figure 21-4.  to open a stencil for editing, open it as an original file or right-click the stencil title bar, and then choose edit.

Figure 21-4.  To open a stencil for editing, open it as an original file or right-click the stencil title bar, and then choose Edit.

Saving and Opening Read-Only Stencils

Sometimes you cannot open a stencil for editing. Visio has two different ways of handling read-only stencils. Most of the time, Visio opens a stencil as a read-only file, but gives you the option to open it for editing. For example, you can drag a master onto a read-only stencil, and Visio prompts you to open the stencil for editing. This is the default Visio behavior for read-only stencils. However, stencils can be saved in such a way that they cannot be opened for editing. This type of read-only protection disables the editing option and displays a message if you try to open the stencil for editing, as Figure 21-5 shows.

figure 21-5.  if a message like this appears when you try to open a stencil for editing, the stencil file has been saved as a read-only file. the original file cannot be edited unless you reset the read-only flag in windows.

Figure 21-5.  If a message like this appears when you try to open a stencil for editing, the stencil file has been saved as a read-only file. The original file cannot be edited unless you reset the Read-Only flag in Windows.

Visio uses the Windows Read-Only flag to specify that the original stencil file cannot be edited. To set this flag, use the regular Save or Save As command on the File menu to save a stencil, but click the drop-down list arrow on the Save button in the dialog box, as Figure 21-6 shows. You'll see two options: Workspace and Read Only. Select Read Only, and then click the Save button to save the file as a non-editable read-only file.

figure 21-6.  if you specify read only when you save a stencil file, the original stencil cannot be opened for editing until you clear the read only flag in windows.

Figure 21-6.  If you specify Read Only when you save a stencil file, the original stencil cannot be opened for editing until you clear the Read Only flag in Windows.

Once a file is flagged as read-only in this way, you can't edit the original file until you reset the Read Only flag. You can do this in Windows Explorer: Locate the file, right-click the file name, and then choose Properties. In the file's Properties dialog box, click the General tab, and then clear the Read-Only check box.

InsideOut


In choosing to use the common dialog boxes of Microsoft Office products, the Visio designers moved some options that used to be check boxes in the Save As dialog box of previous versions of Visio. That's why the Workspace and Read Only options are now tucked away under the Save button in the Save As dialog box.

Opening Template (.vst) Files

Many users are never even aware that they're opening a template when they start Visio and choose a drawing type. Despite the fact that templates have been a cornerstone of Visio functionality since the very first release, the word template seems to confuse people. Nonetheless, when you choose a drawing type on Visio's initial launch screen, you're really opening a template (.vst) file.

When you open a template, Visio's default behavior is to open an untitled copy of the template as a drawing file (.vsd) and open any other windows and files listed in the template's workspace. Just because most Visio templates have a blank drawing page doesn't mean that a template has to have a blank drawing page. For example, you can open a drawing, add a border and title block, and then save it as a template (.vst) file that can be opened to generate other drawings. A template can include more than one drawing page as well, although Visio's templates typically include only one page for ease of use. You can open an original template file to make changes to the template itself, such as adding stencils or setting default styles.

Follow these steps to open the original template file instead of the copy that Visio typically opens:

  1. Choose File, Open. In the Files Of Type list, notice that All Visio Files appears, which means that you'll see template files as well as drawing and stencil files.
  2. Locate a template (.vst) file.

    Visio installs its templates by default in the folders in C:\Program Files\Microsoft Office\Visio10\1033\Solutions.

  3. Select the file name, and then click the drop-down list arrow on the Open button to display a list of options.
  4. Choose Original, and then click the Open button to open the original template file.

The tricky thing with templates is that you're usually opening at least two separate documents, and often more than two. Most templates include a Visio drawing file. That's the drawing page you see when you open the template. In addition, most templates include one or more stencil files. When you open a .vst file, Visio knows to open the drawing file's drawing page in a drawing window and the stencil file's document stencil in the stencil window. When you recall that both drawing and stencil files contain both a drawing page and a document stencil, you'll see that this makes sense.

Templates also include a workspace list with information about the size and position of each open window, as well as the style definitions and colors that are available to users when they create diagrams. The drawing can have its own style definitions and color palette, as can the stencils, so if you're creating new templates, it's important to make sure that style and page settings work together across documents.



Microsoft Visio Version 2002 Inside Out
Microsoft Visio Version 2002 Inside Out (Inside Out (Microsoft))
ISBN: 0735612854
EAN: 2147483647
Year: 2000
Pages: 211
Authors: Nanette Eaton

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net