Chapter 5: Copying, Moving, and Sharing Information Between Programs
Sharing Data Through the Windows Clipboard Copying or moving information from one location to another within a program is easy using the cut-and-paste commands that almost all Windows programs support. Cutting-and-pasting uses the Clipboard to store information temporarily. Moving or copying information between programs is also easy using the Clipboard. You can use the ClipBook Viewer to look at what's on the Clipboard. Some programs also let you use your mouse to drag information from one location to another.
You can use the Clipboard to move or copy text, a range of spreadsheet cells, a picture, a sound, or almost any other piece of information you can create with a Windows application. The Clipboard can hold only one chunk of information at a time, so you either have to paste it somewhere else right away, or not cut or copy anything else until you've pasted the information where you want it. If you cut or copy another chunk of information, it replaces the information already on the Clipboard. To use the Clipboard to move or copy information within or between files, or to share information between programs, you cut or copy the information from one window and paste it in another. You can also use the ClipBook Viewer to see what's on the Clipboard.
Cutting, Copying, and Pasting Cut-and-paste is a feature of Windows that enables you to select information from one file and move or copy it to another file (or to another location in the same file). Cut-and-paste works by storing information temporarily on the Clipboard. The following cut-and-paste techniques enable you to copy or move information within or between almost any Windows application:
- Cut Removes selected information from its current location and stores it (temporarily) on the Clipboard.
- Copy Copies selected information and makes a (temporary) duplicate of it on the Clipboard.
- Paste Copies information from the Clipboard to the location of the cursor in the active application.
To move information, you select it, cut it to the Clipboard, and then paste it in the new location. To copy information, you select it, copy it to the Clipboard, and then paste it in the new location.
You can cut, copy, and paste information by using the following methods (some methods might not work in some applications):
- Menu Choose the Edit menu's Cut, Copy, and Paste commands.
- Keystrokes Press CTRL-X to cut, CTRL-C to copy, and CTRL-V to paste.
- Buttons Many applications have toolbars with Cut, Copy, and Paste buttons, as shown here:
- Mousing Many applications provide shortcut menus that include the Cut, Copy, and Paste commands. Right-click an object to see a shortcut menu.
The Cut and Copy buttons may be disabled if you haven't selected information in the window, and the Paste button may be disabled if no information is on the Clipboard. The following steps explain how to copy or move text from one location to another:
- Select the information you want to copy or move.
- You can select information by highlighting it with the mouse or by holding down the SHIFT key as you use the arrow buttons. The help system of the application you're using will contain more information regarding how to select in that application.
- Be careful when you have information selected. Depending on the application, you can inadvertently replace the whole selection by typing a character or space or by pressing the DELETE or BACKSPACE keys. Usually, a simple click deselects the information, ending the danger.
If you're afraid you deleted something by mistake, press CTRL-Z to undo the change in most programs.
- If you want to copy the information, press CTRL-C, click the Copy button, or choose Edit | Copy. If you want to move the information, press CTRL-X, click the Cut button, or choose Edit | Cut.
- If you are copying, you don't see any change on the screen when you give the Copy command. If you are cutting, however (which is useful if you want to move information), the selected information disappears from the screen--it is now stored on the Clipboard.
- Move the cursor to the place you want the information to appear. This may mean changing applications by clicking a button on the taskbar, or even opening a new application. As long as you don't cut or copy anything else or turn off the computer, the information will be available to be pasted to a new location.
- Paste the text by pressing CTRL-V, by clicking the Paste button, or by choosing Edit | Paste. The information you cut or copy appears at the location of the cursor.
Once you cut or copy information onto the Clipboard, you can make multiple copies of it by pasting it as many times as you want.
Information on the Clipboard takes up RAM, limiting the resources your computer has available to do other things. Therefore, if you cut or copy a lot of information to the Clipboard, paste it quickly. Then, cut or copy something small--one letter or word, for instance--which replaces the large chunk of information on the Clipboard and makes most of the RAM available again. Some programs clear the Clipboard. You can also use the ClipBook Viewer to delete the information on the Clipboard. If you use Microsoft Office 2000 or XP you may see the small Office Clipboard window (in Office 2000) or the task pane (in Office XP). The Office Clipboard stores up to 12 (for Office 2000) or 24 (for Office XP) "clips" from Office applications. Rest the pointer on a clip to see its contents. You can paste any clip by clicking its icon on the Office Clipboard. The Office Clipboard opens automatically after you cut more than one selection for Office applications.
Some programs have problems with cut-and-paste. If you have trouble pasting into a program, first paste the information into Notepad. Then copy it from Notepad and try pasting into the program where you actually want the information to appear.
What Is Drag-and-Drop? Drag-and-drop is another method of moving or copying information from one file to another, or to another location in the same file. To move information from one location to another, select it with your mouse and drag it to its new location.
Not all programs support drag-and-drop. Some programs copy the information you drag, rather than move it. Some programs enable you to choose whether to move or copy the information (for example, a program may enable you to copy the information by holding down the CTRL key while dragging).
Using the ClipBook Viewer to Look at What's on the Clipboard You needn't take for granted that the information you want is on the Clipboard--you can actually look at it by opening the ClipBook Viewer, a program that displays the current contents of the Clipboard. You can't edit what's on the Clipboard, but you can save it as a Clipboard file, with extension .clp. (Clipboard files are a form of HTML.)
ClipBook Viewer seems to conflict with Office XP, so it may not run if you have Office XP installed. To open the ClipBook Viewer (shown in Figure 5-1), choose Start | Run, type clipbrd and press ENTER, or you can open a clipboard file (with extension .clp) from Windows Explorer. You can see two windows in the ClipBook Viewer, the Clipboard window (with the current contents of the Clipboard) and the Local ClipBook window (with your saved clips).
Figure 5-1: The ClipBook Viewer
You might have to install the ClipBook Viewer--it isn't always automatically installed. Open the Control Panel, open Add/Remove Programs, click the Windows Setup icon, highlight Accessories And Utilities from the list of components, click Details, highlight Accessories, click Details again and choose Clipboard Viewer. You can save the current contents of the Clipboard by using File | Save As on the ClipBook Viewer menu (but first make sure the Clipboard window is active). ClipBook Viewer saves the information in a clipboard file with extension .clp. Open a saved clipboard file by choosing File | Open. The ClipBook Viewer can open files saved in the Clipboard format only--you can give them a different extension, but the file is still in .clp format. When you open a clipboard file and the Clipboard already contains information, ClipBook Viewer asks you to confirm that you want to delete the current contents of the Clipboard.
To delete the contents of the Clipboard, choose Edit | Delete, press the DELETE key, or click the Delete (X) button. Deleting the contents of the Clipboard releases RAM for other uses. You can't cut-and-paste information from the ClipBook Viewer window--the information is already on the Clipboard!
Theoretically, the ClipBook Viewer enables you to save more than one clip at a time, by displaying the Local ClipBook window (with Window | Local ClipBook), pressing Ctrl-V, and giving the clip a name. However, we haven't gotten it to work reliably.
Capturing Screens Using the Clipboard Many products can take a screen shot, a picture of whatever is on the screen. This book is littered with screen shots that are used as figures. If you need to create a screen shot, you can use the Clipboard to create one. Use the PRINT SCREEN key that appears on your keyboard--it often is above the cursor control keys with the SCROLL LOCK and PAUSE keys. You can take two different kinds of screen shots:
- A picture of the whole screen by pressing PRINT SCREEN
- A picture of the active window by pressing ALT-PRINT SCREEN
Once the picture is on the Clipboard, you can paste it somewhere else. You may want to paste the picture into a graphics program, such as Paint so you can save it in a graphics file format and use it later. Or, you might want to paste it into a file, such as a word processing document containing an explanation of that screen or window.
What Is DDE? DDE (Dynamic Data Exchange) is another way for programs to exchange information. With DDE, the programs send messages among themselves. For example, say you are running Microsoft Word and you open a .doc file in Windows Explorer.Windows uses DDE to send a message to Microsoft Word, so the .doc file opens in the current Word window, rather than starting up a second copy of Word. You can control what DDE messages your programs send, but programming is required, using macros in programs like Microsoft Word or Excel, or using a programming language like Visual Basic or C++.