Toward a More Intuitive User Interface
What if the object you want to embed is not in a file but is part of a document you haveopen at the moment? You may have already discovered that you can use the Clipboard
to transfer ActiveX objects. For example, to embed part of an Excel spreadsheet into a
Word document, you can follow these steps:
1. Open the spreadsheet in Excel.
2. Open the document in Word.
3. In Excel, select the portion you want to copy.
4. Choose Edit, Copy to copy the block onto the Clipboard.
5. Switch to Word and choose Edit, Paste Special.
6. Select the Paste radio button.
7. Select Microsoft Excel Worksheet Object from the list box.
8. Make sure that Display as Icon is not selected.
9. The dialog box should look like Figure 13.7. Click OK.
A copy of the block is now embedded into the document. If you choose Paste Link,
changes in the spreadsheet are reflected immediately in the Word document, not just
when you save them. (You might have to click the selection in Word to update it.) This is
true even if the spreadsheet has no name and has never been saved. Try it yourself! This
is certainly better than saving dummy files just to embed them into compound documents
and then deleting them, isn't it?
FIG. 13.7 The Paste Special dialog box is used to link or embed selected portions of a document.
Another way to embed part of a document into another is drag and drop. This is a userinterface
paradigm that works in a variety of contexts. You click something (an icon, a
highlighted block of text, a selection in a list box) and hold the mouse button down
while moving it. The item you clicked moves with the mouse, and when you let go of the
mouse button, it drops to the new location. That's very intuitive for moving or resizing
windows, but now you can use it to do much, much more. For example, here's how that
Excel-in-Word example would be done with drag and drop:
1. Open Word and size it to less than full screen.
2. Open Excel and size it to less than full screen. If you can arrange the Word
and Excel windows so they don't overlap, that's great.
3. In Excel, select the portion you want to copy by highlighting it with the mouse
or cursor keys.
4. Click the border of the selected area (the thick black line) and hold.
5. Drag the block into the Word window and let go.
The selected block is embedded into the Word document. If you double-click it, you are
editing in place with Excel. Drag and drop also works within a document to move or copy
a selection.
TIP: The block is moved by default, which means it is deleted from the Excel
sheet. If you want a copy, hold down the Ctrl key while dragging, and
release the mouse button before the Ctrl key.
You can also use drag and drop with icons. On your desktop, if you drag a file to a
folder, it is moved there. (Hold down Ctrl while dragging to copy it.) If you drag it to a
program icon, it is opened with that program. This is very useful when you have a
document you use with two applications. For example, pages on the World Wide Web are
HTML documents, often created with an HTML editor but viewed with a World Wide
Web browser such as Netscape Navigator or Microsoft Internet Explorer. If you double
click an HTML document icon, your browser is launched to view it. If you drag that icon
onto the icon for your HTML editor, the editor is launched and opens the file you
dragged. After you realize you can do this, you will find your work speeds up
dramatically.
All of this is ActiveX, and all of this requires a little bit of work from programmers to
make it happen. So what's going on?
No comments:
Post a Comment