Microsoft Visio Version 2002 Inside Out (Inside Out (Microsoft))

3 4

You can embed Visio shapes or diagrams into Microsoft Office documents. Embedding has some convenient advantages:

The primary disadvantage of embedding is file size. Because all the Visio shape data is stored in the document, its file size can increase dramatically when you embed a Visio image.

You might not be aware that Visio shapes are automatically embedded in an Office document every time you copy from Visio and paste in Office. You can also drag shapes from Visio to a document in Word, Excel, PowerPoint, or other OLE-compliant applications. Just make sure both applications are open and visible and that neither window is maximized, so you can see them both at once. Hold down the Ctrl key while you drag the shape you want from the Visio drawing into the other document.

Note


Dragging shapes from a Visio diagram into a document in another application moves the shapes to the other document and deletes them from the Visio diagram. To drag a copy of the shape, press the Ctrl key as you drag. The pointer displays a plus sign to indicate that you are copying the shape, not moving it. If you accidentally move the object and delete it from the Visio diagram, choose Edit, Undo from the Visio menu to recover it.

If you want to ensure that you don't disturb your original Visio diagram, a safer option for embedding shapes and diagrams is to copy and paste them. First select the shapes you want to embed. Then copy the shapes to the Clipboard using your favorite method of copying: press Ctrl+C, choose Edit, Copy, or click the Copy button on the Standard toolbar. Next, switch to the document in which you want to embed the shapes (for example, press Alt+Tab to switch between open programs in Windows), and press Ctrl+V or choose Edit, Paste. The shapes appear as part of your document. In an Office document or in any other application that supports OLE, the shapes are embedded, so you can edit them from within the document.

Tip


If you paste shapes into an application that doesn't support OLE, the shapes are pasted as a graphic that you can't edit.

Embedding an Entire Visio Diagram

You can embed an entire Visio diagram in another document if you use the Copy Drawing command, as Figure 7-2 shows. If you have a multiple-page Visio diagram, you can copy only one page at a time. You can then embed that page and repeat for each page in the diagram.

Figure 7-2.  To embed an entire diagram, use the Copy Drawing command to copy each page, and then paste in the desired document.

InsideOut


In Visio 2000, when you embedded a Visio drawing that included layers, your layer settings were ignored in the embedded copy. For the most part, this limitation only affected hidden layers, which would unexpectedly appear in the embedded diagram. Fortunately, Visio 2002 doesn't include this restriction. Hidden layers remain hidden, even if you embed your diagram.

To embed an entire page of a Visio diagram, follow these steps:

  1. In Visio, display the page you want to copy and embed.
  2. Make sure nothing is selected, and click Copy Drawing on the Standard toolbar or choose Edit, Copy Drawing.

    Visio copies everything in the diagram, including shapes on other pages and backgrounds. Stencils aren't copied, nor are other parts of the Visio window that aren't part of your diagram, such as the Pan & Zoom window.

  3. Switch to the document into which you want to embed the diagram.

    Tip


    Press Alt+Tab to switch between applications.

  4. Place the cursor where you want to insert the diagram, and then press Ctrl+V or choose Edit, Paste to paste it into your document.


Troubleshooting

You receive an error when you edit a linked or embedded diagram.

The error message you receive may vary, depending on the application you're using and the problem it encounters. Most likely, though, either the application cannot find the original Visio diagram (in the case of a linked diagram) or your computer can't start Visio. Verify the following:


Using Visio Shapes in Other Programs

If you're working in another program, such as Word or PowerPoint, you can quickly add Visio shapes to your document using the same drag-and-drop technique you use in Visio. Although you can always drag shapes from a Visio drawing page or stencil to another application, there's a great shortcut for using shapes without opening Visio. You might find it more efficient to open only a stencil, as Figure 7-3 shows. The stencil takes up less screen real estate than the full Visio application, so it's easier to see what you're doing.

Figure 7-3.  A quick way to add Visio shapes to another document is to open only a Visio stencil file (.vss) using Windows Explorer. Then, you can drag the shapes you want into the document.

The trick is to open a Visio stencil file directly from Windows Explorer when Visio isn't running. In Windows Explorer, double-click on the Visio stencil that contains the shapes you want to use. If Visio is running, you'll see the entire application window, which isn't the desired result in this case. You want to see just the stencil window. When you add a shape to the other application's document, the application adds it as an embedded object. You can then double-click the shape to edit it with Visio drawing tools.

The location of the stencil file depends on how you installed Visio. If you accepted the default destination folders during installation, you'll find stencil files in C:\Program Files\Microsoft Office\Visio10\1033\Solutions\<solution folder>. For example, to open the Basic Network Shapes stencil, navigate to C:\Program Files\Microsoft Office\Visio10\1033\Solutions\Network\Basic Network Shapes (US units).vss.

InsideOut


The Solution folders include stencil files (.vss) and template files (vst). If you open a template file, the entire Visio window opens. If Windows Explorer doesn't display file extensions, you can see whether the file is a template or stencil file by looking in the Type column next to the file, which displays either "Microsoft Visio Stencil" or "Microsoft Visio Template." You can also hover the mouse over a file's icon to display a ScreenTip that shows the file type and other information.

Creating a Visio Diagram Within Another Application

Suppose you're working on a report or presentation and you realize that you can make your point more clearly with a quick timeline or flowchart. You can bring an existing Visio diagram into your document, or create a brand new one, without ever leaving your report or presentation. In fact, any application that supports the current Windows OLE standard allows you to work with Visio in place. This means you can edit Visio shapes within the other application's window, as Figure 7-4 shows.

Figure 7-4.  When you edit a Visio diagram in place, you can use the Visio tools to create a diagram within your application window.

Tip - Check Your Application for Linking and Embedding Support


To find out whether an application supports the latest OLE standard, open the application, and search for an Insert Object command. (You can usually find this command on the Insert menu but it might be located elsewhere.) Check the application's documentation or online Help files as well.

Not all applications support in-place editing. Sometimes, when you edit an embedded or linked Visio diagram, the Visio program window opens instead. The instructions provided here apply to Microsoft Office applications, but the process is similar in any application that supports in-place editing. To create a Visio drawing in place in an Office document, follow these steps:

  1. In your Office document, place the cursor where you'd like the diagram to appear, and then choose Insert, Object.

  2. Select Microsoft Visio Drawing from the Object Type list, and then click OK.

    The Choose Drawing Type window opens just as if you had started Visio to create a new diagram.

  3. Select a template for the type of diagram you want to create, and then click OK.

    A Visio drawing page opens with a set of stencils, and the Visio toolbars and menus replace the original application toolbars and menus. If the Visio program window opens instead, your application doesn't support in-place editing, but you can still create and embed a Visio diagram.

  4. Create the Visio diagram, working as you ordinarily would in Visio—that is, add shapes, connections, text, and so on.
  5. To return to the original application, click somewhere in the document outside the Visio diagram.

    The original toolbars and menus appear. If your application doesn't support in-place editing, and you've been working in the Visio program window, choose File, Exit to return to the original application.

Tip


To move an embedded Visio diagram around on the page, select it, and then drag it by the selection border. Drag a handle on the selection border to resize the embedded diagram.

Editing an Embedded Diagram

To make changes to an embedded Visio diagram—whether you pasted, dragged, or created it in place—double-click the embedded object. For example, if you paste a single Visio shape into an Excel document, you can double-click the shape to open it for editing, as Figure 7-5 shows. If you're working in a Microsoft Office program of recent vintage, the Visio toolbars and menus temporarily replace the application's tools. For other programs, Visio starts in a new window that displays the embedded diagram or shape.

Figure 7-5.  Whether you've embedded one shape or an entire diagram, you can edit it within the document that contains the embedded data by double-clicking the Visio image.

If you embed an entire drawing page or diagram and then edit it, Visio also opens any stencils that were open with the original drawing, as Figure 7-6 shows. To open an additional stencil, use the Open Stencil button on the Standard toolbar or choose File, Stencils and navigate to the stencil you want to open.

Figure 7-6.  You can open stencils from within the Visio editing window when you're working on an embedded diagram.

Tip - Enlarge the Window When Editing in Place


When you edit an embedded object, you can gain working space and resize the drawing in the same way. Point to a handle on the in-place selection border. The pointer displays a two-headed arrow. Now you can drag to change the size of the Visio diagram that is displayed.

When you edit an embedded shape or diagram, you can insert new pages, display the Drawing Explorer or Pan & Zoom window, reorder pages, and more. When you're done making changes, you can return control to the other application in one of two ways:

Make sure to save the document after you make changes to the embedded object. An embedded diagram exists only in the Office document, so if you don't save it, you could lose all your changes.

InsideOut


There's a way to save an embedded diagram as a separate Visio file as long as you're working on a computer that has Visio installed. For example, if you embed a diagram in a Word document and don't save the original Visio drawing file, you can save the embedded object. To do so, select the embedded Visio object, and then choose Edit, Visio Object, Open. This opens Visio with the embedded diagram displayed on a drawing page. Choose File, Save Copy As, and then name the file and choose a location for it.

Sizing an Embedded Visio Diagram

When you copy an entire Visio drawing page and then embed or link it, the size of the Visio object in the new document is based on the page size specified for the original Visio page. Sometimes this can create a large area of white around the Visio object; at other times, the embedded Visio shapes may appear crowded. You can size an embedded object by dragging a handle on the thick selection border, but sometimes that isn't enough. You can also adjust the spacing within Visio. Select the embedded or linked Visio diagram, and then choose Edit, Visio Object, Open or Open Link. Then do one of the following:

Tip


To return control to the other application, click anywhere outside the Visio drawing window.

Pasting Without Embedding

If you don't expect to edit a diagram or shapes that you're displaying in another document, you can keep your file size smaller by pasting without embedding. You won't be able to double-click the diagram and have instant access to all the Visio tools, but you also won't clutter your file with all the information that a document includes to support OLE. You can use the Picture or Picture (Enhanced Metafile) options in the Paste Special dialog box to paste Visio shapes into an Office document in a way that takes up less space, as Figure 7-7 shows.

In Visio, you can copy the shapes you want. To copy an entire page, choose Edit, Copy Drawing. In the Office document, position the cursor where you want to insert the diagram or shapes, and then choose Edit, Paste Special. Select either Picture or Picture (Enhanced Metafile), and then click OK.

Figure 7-7.  To paste Visio shapes into another document without embedding them, choose Edit, Paste Special to display these options.

Tip


The Paste Special command works in Visio, too, and is a great way to paste text from Microsoft Word when you don't want to retain its formatting. Paste it as Unformatted Text.

Категории