Mastering Visio 2007 Documents

Behind every shape, template, and solution in Visio 2007 is a file format that makes customization possible. If you want to create your own stencils or customize templates, you need to understand this fundamental fact of Visio 2007 life: All Visio 2007 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. That is why when you open a stencil (.vss) file, you typically don’t see the drawing page, or when you create a new drawing (.vsd) file without a template, you don’t see a stencil.

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

1.
Start Visio 2007.

2.
If Visio 2007 is already running, save any changes, and close all open Visio 2007 documents.

3.
Choose File, New, New Drawing (it doesn’t matter if it is metric or uses U.S. units).

Visio 2007 opens a blank drawing page and no stencils.

4.
Choose File, Shapes, New Stencil.

Visio 2007 opens a blank stencil. Figure 21-1 shows the spanking clean drawing page opened in step three and the blank stencil opened in step four. Keep in mind that the drawing page and stencil are separate entities. Their uses are entwined, but one can exist on your Visio 2007 desktop without the other.

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


Why is this important? The fact that a Visio 2007 file has both a drawing page and a stencil has ramifications that can help you work with shapes more efficiently and keep file size down when you customize stencils and templates. Visio 2007 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 if you edit masters on a document stencil, the change will affect all the copies of the master in that drawing file.

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

  • Drawing (.vsd)

  • Stencil (.vss)

  • Template (.vst)

The Visio 2007 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 2007 file using any other Visio 2007 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 2007 recognizes other file name extensions as well. A Visio 2007 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 2007 drawing, stencil, or template saved in XML format. For details, see the section titled “Visio 2007 and XML File Formats” later in this chapter.


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

In versions of Visio earlier than Visio 2003, 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 Microsoft Office Word 2007 file or the thing you create when you press Ctrl+N. The equivalent generic term in Visio 2007 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 2007, you create a drawing file. When you open an existing drawing file, Visio 2007 opens all the windows and files that were open when the file was last saved. Visio 2007 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, Shapes, Show Document Stencil.

Each Visio 2007 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 2007 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. If you customize the file’s color palette and style lists, those changes will be saved with the file. VBA projects, which have their own modules, class modules, and user forms, will also be saved with the file.

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 safeguard feature of Visio 2007. 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 2007 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 2007, which generally is not a good idea unless you have virus-scanning software installed on your computer. To do this, choose Tools, Trust Center, and click on Macro Settings in the left-hand pane. Click on Enable all Macros (this really isn’t recommended), then click OK.

Opening Stencil (.vss) Files

The philosophy of the Visio design team has changed somewhat since the early versions of Visio. In the beginning you could edit stencils and master shapes right on the stencils they inhabited, but beginning with Visio 2003 any changes to Master Shapes must be saved to a new custom stencil.

A Visio file with the .vss extension is sometimes referred to as a stand-alone stencil to differentiate it from a document stencil. A stand-alone stencil can be opened by itself or with a template. It cannot, however, be edited.

To open a stencil, it’s quickest to click the Shapes button on the Standard toolbar, browse through the templates, and then choose the stencil you wish to open.

Note

You can create a new, editable stencil. To do so select File, Shapes, New Stencil (They come in two flavors: Metric and U.S. units). Drag shapes from the drawing page to your stencil to save the shapes.


Although you cannot edit the stencils included with Visio 2007, you can make your own stencils composed of the shapes you most often employ in your drawings. Here’s how:

  • Right-click a shape in any stencil, which displays the submenu displayed in Figure 21-3.

    Figure 21-3. You can save a shape to one of your custom stencils by right-clicking it and choosing an option from the context menu.

  • From this menu you can save the shape to a previously constructed custom stencil (by either selecting a displayed stencil or clicking Add To Existing Stencil).

  • If you save it to a new stencil, you’ll be prompted to name the stencil.

Note

You can also select File, Shapes, New Stencil to open a new, blank, editable stencil. Note that you can no longer edit Visio 2007 stencils or the master shapes that they contain unless they are either the document stencil or a stencil you have created. On a Document stencil, you can edit only the masters. However, if you create a stencil, you can edit anything on your custom stencil.


After you have edited a custom stencil, you can save it by selecting File and choosing Save or Save As. If you are saving the stencil for the first time, Visio 2007 displays the Save As dialog box, shown in Figure 21-4. The Save drop-down menu in the lower right of the Save As dialog box allows you to save the file as a Read-Only file.

Figure 21-4. You can choose a name for your custom stencil in the Save As dialog box.


Saving and Opening Read-Only Stencils

Sometimes you cannot open a custom stencil for editing. Visio 2007 has two different ways of handling read-only custom stencils. By default, Visio 2007 prompts you to open the stencil for editing if you drag a master onto a read-only custom stencil. However, stencils can be saved in such a way that they cannot be edited. This type of read-only protection disables the editing option, as Figure 21-5 shows.

Figure 21-5. If a message like this appears when you try to edit a stencil, the stencil file has been saved as a read-only file.


Visio 2007 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: Save and Read only. Select Read Only, and then click Save to save the file as a noneditable, 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.


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 by locating the file, right-clicking the file name, and then choosing Properties. In the file’s Properties dialog box, click the General tab, and then clear the Read-Only check box.

Note

Remember in Visio 2007 only custom stencils—in other words, user-created stencils—can be edited. Stencils that ship with Visio 2007 are permanently locked.


Inside Out: The Read Only option

In choosing to use the common dialog boxes of Office products, the Visio designers moved some options that in earlier versions of Visio used to be check boxes on the Save As dialog box. The Read Only option is 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 2007 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 2007’s initial launch screen, you’re really opening a template (.vst) file.

When you open a template, Visio 2007’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 2007 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 2007’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 2007 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 2007 installs its templates by default in the folders in C:Program FilesMicrosoft OfficeOffice121033.

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 Open Original, and then click Open Read-Only 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 2007 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 2007 opens 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 drawing and stencil files each 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset