Working with the Windows Clipboard


Although not an application per se, the Clipboard is an integral part of Windows, and is typically used when working with applications. Chapter 4 introduced the Clipboard indirectly, explaining how to cut, copy, and paste items, particularly files and folders within the Windows GUI.

Because transferring data between applications and documents is such a common task, this chapter offers some additional detail on the techniques you can use to facilitate the process.

The most basic sort of information sharing relies on the Windows Clipboard. As you're probably well aware, you can cut, copy, and paste information from one application to another with relative abandonassuming both applications allow you to work with the kind of information you're transferring (text, graphics, or musical notes, for example).

Almost all Windows applications use the Clipboard for everyday, on-the-fly data-transfer operations. The Clipboard lets you move text, graphics, spreadsheet cells, portions of multimedia files, and OLE objects from one location to another. It supports both 16-bit and 32-bit Windows programs and can even move text to and from non-Windows programs, within the constraints I explain later in this chapter.

Information cut or copied to the Clipboard goes into system memory (RAM and virtual memory), waiting there until you paste it to a new location elsewhere in the same document or in another document. Even then the data remains on the Clipboard until it's replaced by new cut or copied information or until you exit Windows. The upshot of this arrangement is that you can paste the same information as many times as needed, into as many different locations in your documents as necessary.

Want to know what information currently resides on the Clipboard? Run the ClipBook Viewer utility that comes with Windows XP to view the Clipboard contents as well as to store Clipboard information on disk (in CLP files or ClipBooks) for later retrieval. You won't find that program on your All Programs menus, but if you Click Start, Run, and enter clipbrd, it should come up. Double-click on the Clipboard's title bar (which is probably minimized at the bottom of the Clipbook Viewer window), and you can see what's in the Clipboard at any given time. Though you may seldom use it, the Clipbook Viewer can be used to share Clipboard contents over the local area network. It's a little tricky to do so, however, and rarely used. Figure 5.13 shows an example of some text on the Clipboard.

Figure 5.13. Checking the contents of the Clipboard using the Clipbook Viewer application.


NOTE

Some Windows applications maintain their own independent Clipboard-like storage areas for cut or copied data. These proprietary clipboards overcome some of the weaknesses of the main Windows Clipboard. For example, whereas the Windows Clipboard can hold only one chunk of cut or copied data at a time, Microsoft Office 2003/XP has its own "clipboard" that stores up to 12 chunks. In Office 2003/XP apps, a special toolbar pops up as the Office clipboard fills up. The toolbar displays each chunk of data with an icon identifying the data's source application, and you can paste the chunks in any order you need them into your Office 2003/XP documents.


Copying, Cutting, and Pasting in Windows Applications

Windows XP maintains time-honored Windows standards (most of them date all the way back to Windows 2.0) for selecting, cutting, copying, and pasting information. This section offers a brief review of the techniques you need. In summary, four steps are required to transfer data from one place to another via the Clipboard:

1.

Select the data. The techniques required to select data depend on the type of information in question and the application you're using. If you're working with text, you can drag across the characters to be selected, or, if you prefer a keyboard approach, hold down the Shift key while you use arrow keys and other cursor movement keys to expand or reduce the selection. Many programs let you select entire lines or paragraphs using techniques such as clicking or double-clicking in the left margin. Selected text appears in reverse colors.

With graphics and other non-text information, selection techniques vary, but you typically just click on the item you want to select, Shift+click to select a series of adjacent items, or drag over adjacent items to select them together. In many applications you can also Ctrl+click to select nonadjacent items. You can usually tell that an item has been selected by the appearance of an outline or small rectangles on its perimeter.

2.

Cut or copy that data to place it on the Clipboard. Choose Edit, Copy to place the selected data on the Clipboard without disturbing the original. You can also choose Edit, Cut to put the information on the Clipboard and remove it from the source document. As mentioned in Chapter 4, many applications let you right-click over the selection and choose Copy or Cut from the shortcut menu that pops up. With the keyboard, the standard shortcuts are Ctrl+X for Cut and Ctrl+C for Copy; however, some applications don't abide by these conventions.

3.

Identify the destination for the information by selecting the destination document and, if appropriate, navigating to a specific location in that document.

4.

Paste the data into the destination document. With the mouse, choose Edit, Paste or choose Paste from the shortcut menu. Using the keyboard, pressing Ctrl+V does the trick, except in the odd, nonstandard application. With any of these techniques, the contents of the Clipboard will appear in the new location.

If the Paste command fails to paste the data into the destination document, see "Paste Command Doesn't Work" in the "Troubleshooting" section at the end of this chapter.


If the pasted data doesn't look like you expected, see "Pasted Data Doesn't Look Right" in the "Troubleshooting" section at the end of the chapter.


NOTE

Almost all Windows applications have Cut, Copy, and Paste commands on their Edit menus, but that doesn't mean these commands are always available. If you haven't selected anything to be cut or copied, for example, the Cut and Copy commands will be inactivethey appear grayed out on the Edit menu and you can't choose them. For its part, the Paste command can be grayed out even if data is currently on the Clipboard. This happens when the application doesn't recognize the data format in which the Clipboard data is stored.


NOTE

Many Windows applications place cut or copied information onto the Clipboard in multiple formats. For example, suppose you copy some text from Microsoft Word. When the copy operation is complete, the Clipboard will contain at least four representations of that same text: a "plain text" (nonformatted) version, a version in the Rich Text format, a version in HTML, and a picture (an image of the text stored as a line, or vector, graphic). When you paste, the destination application communicates with the Clipboard to decide which format to use. In some cases, the application also has a command that lets you take manual control and decide the right format for yourself. At any rate, the availability of all these formats means that you have a better chance of successfully pasting the data into the destination document.




Special Edition Using Microsoft Windows XP Professional
Special Edition Using Microsoft Windows XP Professional (3rd Edition)
ISBN: 0789732807
EAN: 2147483647
Year: 2003
Pages: 450

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net