HOME BACK FORWARD

Using Windows NT Workstation 4.0

- 12 -
Using Windows to Tie it All Together

In this chapter:

With Windows, you can combine text, graphics, charts, tables--whatever--into magnificent, attention-getting documents...

When you're ready for a great meal at a great restaurant, you certainly don't expect that one person will prepare the whole thing. There's a crew of assistant chefs who slice, dice, and chop all the different ingredients. The vegetables are over there, the meat and seafood are over here, and the pastry chef is in a world of her own. If the master chef is running things right, though, all those pieces come together to form a perfect presentation on your plate.

Windows lets you work the same way--with Windows playing master chef to all those assistant chef programs. You might have a formatted report in your word processor, a set of charts and pictures in your graphics program, and a stack of numbers in a spreadsheet program. When it's time to blend all the ingredients into one good-looking document, Windows makes it easy. The secret? Learning how to cut, copy, and paste.

Cut, copy, and paste: the easy way to move things around

When you want to take a little data from here and put it over there, the technique is the same, no matter where you are in Windows. It doesn't matter whether you're moving between two different places in the same window or between two completely different applications--thanks to Windows, you'll always follow exactly the same procedure.

If you managed a warehouse, you'd probably carry around a clipboard, big enough to securely hold a few sheets of letter-sized paper. To manage the process of transferring data, Windows uses a similar holding area called the Clipboard. As you move from place to place in Windows, the Clipboard stays discreetly alongside you. Most of the time, you don't even notice that it's there. When you want to move something from one place to another, though, it's right at your fingertips: You pick up the thing you want to move and fasten it to the Clipboard. Whatever you placed on the Clipboard stays there as you move to your next destination. When you're ready to set the copied object down in its new home, just unfasten it, and put it where you want it.

Using the Clipboard to cut, copy, and paste is simple, as long as you remember the universal rule of Windows: first you select, then you act:

1 Select the thing you want to copy or move. It could be anything: a word or sentence, a few cells from a spreadsheet, some or all of a picture. Use the technique that works for the application you're in. For example, in WordPad, hold down the left mouse button as you drag across the words you want to highlight.

2
Right-click the highlighted section, and then choose Cut or Copy. You'll see a menu like the one in Figure 12.1. (If your application doesn't use popup menus, look for Edit on the pull-down menus.) Windows takes a snapshot of whatever is highlighted and places it in the Clipboard. If you chose Copy, your document remains just as it was; if you chose Cut, whatever was highlighted is now gone.

3
Move the mouse to the place where you want to paste the copied material. This could be in the same document, or in a completely dif-ferent document in another application. Click to be sure the insertion point is where you want it to be.

4
Right-click at the spot where you want to insert the data from the Clipboard, and then choose Paste. Whatever is on the Clipboard will appear at the insertion point.


Fig. 12.1

To put the selection from this WordPad document onto the Clipboard, use the right mouse button to pop up this menu. Use the same menu to paste it into its new location.


CAUTION: The Clipboard can hold only one thing at a time. If you've copied or cut something, it will wipe out anything that's currently being stored on the Clipboard. That's why, if you're shuffling a lot of data around, it's always a good idea to paste it into its new home immediately after you've cut or copied it to the Clipboard.

What happens when I paste data?

When you paste something from the Clipboard, Windows tries to figure out the most appropriate action to take with the specific type of data you've put there. It's easiest when the type of data you're pasting is exactly the same as the surrounding data in the place where you intend to paste it. Results are less predictable when the data types are very different; for example, when you have a paragraph of text on the Clipboard and you're thinking of pasting it into a bitmap picture in Paint. Here's a sampling of what you can expect:


Plain English, please!

A bitmap image is one that consists of different-colored dots (bits) that the eye sees as a single image. (If you look closely at a newspaper photo you can actually see these dots.) Bitmaps are useful for simple pictures, but the dots can't be stretched; so when you try to change the size or shape of the image, the results will usually be ugly. For those kinds of tasks, graphics artists use sophisticated vector formats that tell Windows how to draw the picture at any size and shape. The Windows Paint program uses only bitmaps.


Can I cut and copy with a DOS program?

It's easiest to move things between Windows programs, but there's a special set of procedures for copying text to and from MS-DOS programs. Here's how:

1 Open your MS-DOS program in a window. If it opens in full-screen mode (where it takes over the entire screen, with no taskbar, no title bar--no evidence of Windows anywhere), force it into a window by holding down the Alt key while you press Enter.

2
Click the icon at the far left edge of the DOS program's title bar to unfurl the pull-down control menu. (See Fig. 12.2 for an example.)


Fig. 12.2

Run any DOS application in a window and you can cut, copy, and paste text between it and Windows applications.

3 Choose the Edit command; a cascading menu will appear to the right.

4
To copy part or all of the screen, choose Mark. This switches the mouse into marker mode, which allows you to swipe it across any portion of the DOS screen to highlight a rectangle. When you've marked the section you want to copy, press Enter. Whatever you marked is now available on the Windows Clipboard, and you can paste it anywhere you want.

5
To paste text from the Clipboard into your DOS program, make sure the insertion point is at the right spot in your DOS screen. Next, use the same pull-down menu to choose Edit, Paste.

What's so special about Paste Special?

When you highlight part of a document and right-click on it, you'll almost always see the same three choices: Cut, Copy, and Paste. But when you use the pull-down Edit menu instead, you'll sometimes see a fourth option as well: Paste Special. What's so special?

The plain old Paste command acts instantly. But when you choose Paste Special, Windows waits for more instructions from you before it actually inserts the contents of the Clipboard. The options it presents to you are context-sensitive; your exact choices depend on the format of the data you've placed on the Clipboard.

Why would you want to do this? It's a good way to save time if you want to choose a different format for whatever you're pasting, or if you want to get rid of any formatting completely. For example, you might want to copy some text from a report you wrote in WordPad or Microsoft Word, then paste it into a letter. If you used Paste, the text you added to the letter would retain the formatting of the report text. To make the newly pasted text blend in properly, you'd have to fuss with fonts and margins.

Instead, copy the section to the Clipboard as usual, then move to the second document and Select Edit, Paste Special. You'll see four choices, as shown in Figure 12.3.


Fig. 12.3

When you use Edit, Paste Special, you have more control over how the words on the Clipboard wind up in their destination.

There are two options you'll use most often. The first is Rich Text, which lets you transfer the words and the formatting together. The other useful option, Unformatted Text, simply pastes in the words, which then pick up whatever format is already in your document.


TIP: Are you tired of constantly shifting your hands between the keyboard and the mouse? Try these universal shortcuts instead: Ctrl+C copies the current selection to the Clipboard; Ctrl+X cuts it; Ctrl+V pastes the contents of the Clipboard to the current insertion point.

All about OLE

You can't pick up a new Windows program without hearing the term OLE (it's generally pronounced oh-lay, like the shout you might hear at a bullfight, although you can also refer to it by spelling out the letters). What's it all about? OLE stands for Object Linking and Embedding, which is an extremely technical term for the act of working with two types of data in one place.

You've already seen how copy-and-paste (or cut-and-paste) works. When you select some data and paste it into a different document, it becomes part of the second document. You can make changes to the original document from which it came, but those changes won't be reflected in the fragment that you pasted somewhere else. If you make a lot of changes, you could spend days or weeks recopying and repasting the same data to all the places you pasted copies!

Linking and embedding are two ways to avoid doing all that rework. I'll talk about each of them in detail, later in this chapter. For now, it's sufficient to know that when you link two documents, or when you embed information from one document in another, Windows stores information about the connection between the two documents. This technique lets you edit information in an original document and guarantee that your changes will show up wherever there's a reference to this document.

Using different types of data in one file

Let's say you've written a report in WordPad. You know what you want to say, but you need to add a sketch or a map to make it easy for your coworkers to see what you're talking about. So you fire up the Windows Paint program and create your own work of art. Those are two completely different kinds of data. Can you really mix words and pictures together?

Yes, you can. In fact, you have several choices for how to mix and match different types of data in a single document.

You can paste the picture into your document, using one of several formats. You can embed the picture in the document, or you can link the picture to the document. The technique you choose will dictate what you can do with the document later.

What's the difference between pasting, linking, and embedding? To understand the distinction, let's imagine that we're in a fancy restaurant--the kind where there's more silverware in front of your plate than you'll use at home in an entire month. You've asked the waiter to bring you some oil-and-vinegar dressing for your salad. Instead of going into the kitchen, though, he goes into the back office and uses his Microsoft Salad Dressing for Windows software. What happens next?

I want these two kinds of data mixed into one document

Our waiter could just pour a little bit of oil into a big bottle of vinegar and bring the whole bottle to the table. He might have to shake things up to get it to look good, but for all practical purposes, you see one big bottle of salad dressing in a bottle labeled "Vinegar." (If our waiter is smart, he'll relabel the bottle "Oil-and-vinegar" before he brings it to our table.)

In Windows terms, that's exactly what happens when you simply paste one type of data into a document that contains another type of data--for example, when you insert a picture into a WordPad document. The data that you're pasting (the oil) gets added to the original document (the vinegar) in a format that the original document can recognize. For all practical purposes, the drawings and words mix together to form a single document that you can use without any fuss. The label on the outside says that it's a WordPad document, but you know there's a drawing mixed in with it. Most importantly, there's no easy way to take the pasted picture back out, any more than you could extract that oil from the vinegar and start all over again.

I want two kinds of data to travel together without being mixed

Let's say that our waiter isn't certain how much oil you want with that vinegar. So, instead of mixing it up for you he brings two bottles to the table--a large bottle of vinegar and a small one filled with oil. He doesn't want the two bottles to get separated, so he fastens the smaller bottle to the side of the larger bottle and brings it to the table. You can see what's in each bottle without any work at all, but to put the dressing on your salad, you have to open each bottle separately.

In Windows terms, the big bottle is the container, the smaller bottle attached to it is the embedded object, and the complete package is called a compound document. The second document is literally stored right alongside the first so that the two types of data never mix. When you embed one piece of data in a file that contains another kind of data, they're not mixed together, so you can edit either one separately. Just as you could replace the olive oil with canola oil, you could change the picture without having to start all over.

Even though they travel together and can be looked at together, the data types in a compound document (words and pictures in the case of our document, oil and vinegar in the case of the salad) remain completely separate. If someone across the table asks you for the salad dressing, you hand them the complete package. Likewise, if you send your two-in-one document to someone else, you don't have to worry about them getting separated. And best of all, you can click on the embedded document to edit it using the program that you originally used to create it.

I want to use two kinds of data together but store them separately

OK, let's say this restaurant is fancy, but not very well-stocked. There's a bottle of vinegar on every table, but there's only one bottle of oil. Attached to each big bottle of vinegar, there's a picture of the bottle of oil, along with a note that tells you to ask the waiter when you want to add dressing to your salad. Just ask, and the waiter will bring the bottle of oil from the pantry, stand there while you use it, and return it to the pantry when you're done.

Why on earth would you want to do something this complicated with your data? Well, imagine that the picture is your company's logo. If you embed a separate copy of the logo into all your documents, you'll have a heap of work ahead of you if your company logo changes--you'll have to find each document and change the embedded logo in each one. A better solution is to keep the logo art in a central file and include instructions for finding the linked object--in this case, the logo file stored on your company's network.

Links always contain both a picture and a set of instructions for finding the original. So if you send a file with the linked logo to someone else, she can see what the logo looks like. She can even print it out. But if she wants to change the logo, her application will have to follow the instructions in the link to find the original logo and the application that created it.

How do I recognize an embedded or linked object?

Most of the time, when you've pasted one object into another, the document you end up with will look smooth and seamless, with no evidence of the pasting you've done. But you will notice a difference if you click on an embedded or linked object. When you do, you'll see a dark line that forms a box around the object. In each corner, and in the middle of each side of this box, you'll see black squares called sizing handles. (See Fig. 12.4 for an example.) You can drag these handles in any direction to change the size and shape of the object. (But remember, if that's a bitmap image, you probably won't like what happens when you start tugging and stretching!)


Fig. 12.4

The dark box and square handles around this object are your visual cues that this is an embedded object. Right-click on it for more information about what it is and what you can do with it.

What am I supposed to do with an embedded object?

To select an embedded or linked object, just click it. Like any object anywhere in Windows, the best way to find out more information about what it is and what you can do with it is to right-click it.

If you've embedded or linked an object from one program into a document created by another program, you don't necessarily have to do anything special with it.


Fig. 12.5

Right-click an embedded object, and choose Properties to see what you can do with it. The same popup menu also includes the option to edit the picture.


TIP: Remember, the menus that pop up when you right-click on an object change to reflect what Windows can do with that object. So, if you're not sure what an object is, use the right mouse button!

Do I really need to worry about OLE?

Most of the time, you don't really need to be concerned about how you're cutting and pasting between two different places. Windows looks at the different types of data you're trying to mix together, makes a few assumptions about what you probably want to do, and then takes care of the details.

When you're not sure what will happen, try the Paste command first. If you're not satisfied with the results, undo what you just did and try again with Paste Special.


Q&A: I pasted something into a document, and now there's a box around it. What's that all about?

Congratulations! You just embedded one type of data inside another without even realizing it. If that's not what you wanted to do, you'll have to tell Windows to do the paste differently. Go to the Edit menu and choose Paste Special. This time, you'll see a dialog box with a list of the options available to you. As you highlight each option in the list, look in the Results area at the bottom of the dialog box to see what will happen, then choose the one that matches what you want.

HOME BACK FORWARD

© Copyright, Que Corporation. All rights reserved.