Smart Computing ® Smart Computing ®
Top Subscribe Today | Contact Us | Register Now   
middle
Home | Tech Support | Q&A Board | Article Search | Subscribe & Shop   


Compound Documents Email This
Print This
View My Personal Library

Office Computing
March 1999 • Vol.10 Issue 3
Add To My Personal Library

Compound Documents
Create Documents With The Features Of Multiple Programs
It is common to need a table while writing a Microsoft Word document or to need a chart while preparing a Microsoft PowerPoint presentation. The easiest way to add one of these components is to use another program, such as Microsoft Excel, to produce the table or chart and then insert the table or chart into the original document.

When a document contains data from more than one program it is a compound document. The software that creates the compound document is the container program. Any software that supplies data for the compound document is a source program. Compound documents can have multiple source programs, meaning you can create powerful combinations of information in a single file. When you master the skills of creating compound documents, you can begin thinking in terms of what information you want to include, not what information your current application lets you convey.



We inserted a Microsoft Excel table into a Microsoft Word document using the cut-and-paste technique to create this memo.
The three approaches to placing information from one document (Excel in our example) into another document (Word in our example) are cutting and pasting, linking, and embedding. We'll show you how to use each method, plus we'll discuss the advantages and disadvantages of each. By the end, you will know how and where to use each approach. While we used Word and Excel to illustrate this article and discuss the concepts, many other programs can benefit by receiving objects from other programs. Additionally, many programs are able to offer up objects for use by other container programs.



Cut & Paste



Cut and paste is the first method most people learn for creating compound documents. With this approach, you produce the document in Word and the table in Excel. You then highlight the data in Excel, open the Edit menu, and select the Copy command. This places a copy of the information into the Windows Clipboard without disturbing the original Excel copy. Had you wanted to delete the information from Excel, you could have selected Cut rather than Copy.

Next, switch to Word and position the cursor at the point where you wish to insert the table. Then, click the Edit menu and select Paste. The process is the same as using cut and paste in any Windows program to move data around a document, only here we are moving the data between documents and programs.

Advantages and disadvantages. The major advantage to cut and paste is it is the simplest approach to creating a compound document. It uses the most appropriate software to create each component of the document and then assembles those components into one master document. In addition, users with the software used to create the master document (the container program) can then view the resulting document even if they do not have all the software packages used to construct the individual components of the master document.

The major disadvantage to cut and paste is the static nature of the components. If the Excel table in the above example changes, the memo does not change nor does the table in the memo. The only way to update the memo is to update the table in Excel and then to manually repeat the transfer. This need for manual updates can lead to problems. For example, imagine an environment where several documents use one Excel table. It is easy to understand how you could easily overlook updating one of those documents when you make a change to the table.

File size, especially when pasting large charts or images, is another disadvantage. Because there is one copy of the image in the source program and a second copy in the container program, you double the storage space. When the data is storage-intensive, as with charts and images, this can be a particular burden.



Linking



The second approach to creating a compound document is to create an electronic link between the source and compound documents. Using this method, the table stays in Excel. This means each time you load the memo, Word reads the latest version of the table in Excel. This approach, and the next, use Windows' object linking and embedding (OLE), which is a method for sharing information between applications.



When creating a compound document using the linking technique, you need to create a shortcut to the source file by creating a link to the master document.
To create a link, highlight the data to transfer and select Copy from the Edit menu. (NOTE: Because you need the source program to maintain the data, you cannot use the Cut command rather than Copy.) When you switch to the container program, place the cursor at the point where you wish to place the table. This time, you select Paste Special from the Edit menu. Next, you need to create a link by selecting the Paste Link option on the left side of the dialog box. Usually, the container program will figure out the type of information stored in the Clipboard and make the appropriate selection for the As field in the dialog box. You can, however, override its selection.

The resulting document appears to be identical to the cut-and-paste version, but it is not. The Word document only contains the information Word needs to go out and request this table from Excel. If you select Options from the Tools menu, click the View tab, and put a check beside Show Field Codes, Word will show you the linking code rather than the results.

Advantages and disadvantages. The main advantage of linking is the compound document is always up-to-date. If you change the data in Excel while the Word document is loaded, the table in Word immediately updates. If the Word document is not loaded, the table will automatically update the next time you open the Word document. This updating happens automatically, without the user having to remember to do anything. Additionally, there is only one copy of the data, so you do not waste space storing multiple copies.

Linking is particularly useful in a corporate setting, when document creation is a collaborative effort. By pulling components together into a compound document, multiple users can update the components, and the compound document will remain current. In fact, as long as the author has the necessary permissions, he or she can locate the various components anywhere on the corporate network.

Linking has two main drawbacks: higher software requirements and less document portability. The container program depends on the source program to prepare and maintain its data. Thus, everyone wishing to view the compound document must have access to every source program used to prepare that document. In our example, viewing the memo with the table requires access to Word and Excel.



Once you insert an Excel chart into your Word document, you have the option to view the linking code rather than the results.
Because the container program pulls the components in for display in real time, you must have every component available to view the document. If you are viewing the compound document on multiple computers, the components must be available in the exact same location on each machine. This presents logistical problems when transferring a document to a portable computer, especially if some of the components are on a network. If you do not transfer all of its components, you will not have access to the entire document.



Embedding



If you have ever used the Equation Editor or Organization Chart applets with Word or the Chart or Organization Chart applets with PowerPoint, you have already used the embedding process. When you embed a component in a document, it has no existence outside that document. When you embed an Excel table inside a Word document, it can be a previously created table or a blank table. Anytime you add to or change the information in this table, the information will be saved as part of the Word document file.

Because you created the component inside the compound document, there is no need to first create it with another program. You begin by positioning your cursor at the appropriate position in the compound document. You then click the Insert menu and select Object. Next, select the type of object to insert. Your list of available objects will depend on the type of software on your machine.



If you use the embedding technique to insert your Excel chart into your Word document, you can see Excel's menus, toolbars, and grid.
Starting with Office 97, Word began handling the positioning of objects differently. In prior versions, the position of objects was at a specific point in the document. If you wanted to move the object around on the page, you had to place it inside a frame and then move the frame around. Office 97 dropped frames in Word, so the Object dialog box has the option to Float Over Text. This means you can position the object anywhere on the page by simply dragging it to a new location. The drawback to floating over text is the object is not visible in Normal (draft) view and keeping the object in a specific location, relative to text, is difficult. Unless you are inserting graphics, you will typically want to uncheck the float over text option.

In the completed worksheet, even though the document is in a Word document, you can see the menus and toolbars are from Excel. You also can see the Excel grid is showing. To return to Word and cause the object to appear as a table, you simply click outside the object. To edit the object again, you simply double-click the object to automatically return to Excel inside Word.

Initially, Excel may show more rows or columns than you wish. You can change this by dragging the sides of the display while editing in Excel mode. If you wait until you return to Word, dragging the sides simply changes the size of the object without changing the number of displayed rows or columns. Many other programs will automatically scale their objects so only data is showing without much blank space around the data.

Advantages and disadvantages. The main advantage of embedded objects is how easy they make transporting data between machines. Since a single file stores everything, you simply copy one file to a new computer to transfer everything. Additionally, since you have only one copy of each object, you save space. When you take the source file, everything goes. These advantages are particularly important for PowerPoint presentations that users will develop on a desktop machine and then display on a portable computer.

Embedding has no major disadvantages and is often the preferred method of producing compound documents. One relatively minor disadvantage is you cannot share the same object with multiple compound documents, as you can with linking. This is rarely useful, however, with smaller sets of data. Like linking, embedding also requires that the user have access to all the software packages used to create the compound document.



Your Best Bet



The cut-and-paste technique is great for the quick-and-dirty transfer of information between programs. It is rarely the method of choice, however, when the information has potential to change or needs to be updated periodically. Linking is the method of choice when someone other than the author of the compound document will be producing some of the information or when a compound document only needs to use a small part of a much larger document. Embedding is the best approach when one author is producing all the information and when other documents will not need its information.

Once you get experience with compound documents, you will find many uses for them.

by Ronny Richardson





Want more information about a topic you found of interest while reading this article? Type a word or phrase that identifies the topic and click "Search" to find relevant articles from within our editorial database.

Enter A Subject (key words or a phrase):
ALL Words (‘digital’ AND ‘photography’)
ANY Words (‘digital’ OR ‘photography’)
Exact Match ('digital photography'- all words MUST appear together)





Home     Copyright & Legal Information     Privacy Policy     Site Map     Contact Us

Copyright © 2010 Sandhills Publishing Company U.S.A. All rights reserved.