Chapter 4 Leveraging Microsoft Office in Your Applications

Team Fly 

Page 93

Chapter 4
Leveraging Microsoft Office in Your Applications

EFFICIENTLY ACCESSING ONE APPLICATION'S features from within another application is a longstanding goal in the programming community. After all, if you can run a spell-check on documents within Word for Windows, why can't that same Word spell checker work just as effectively on documents held anywhere within the computer? Restricting such a useful utility to only documents within a particular application seems like an unreasonable limitation.

Indeed, the difficulty of communicating data between applications and sharing functionality was originally one of the primary justifications for object-oriented programming. The idea was that you should be able to write your programs in ways that permitted the features (objects) in your applications to be self-contained, reusable, and capable of being consumed by other objects (either inside or outside your application).

As usual, these noble goals have been less achievable in practice than they seemed in theory. There's still quite a bit of individuality and idiosyncrasy floating around in the computer world. The goals of application independence, not to mention platform independence, always seem to move just a bit out of reach as we approach them.

Nonetheless, Microsoft-designed products such as the Office suite and the .NET languages do offer a degree of interoperability and free communication between objects. How to understand the object models and consume methods within .NET and Office applications is the topic of this chapter. We'll focus on three of the most useful Office products—Word, Outlook, and Excel—but the techniques described for accessing these applications are applicable to other Office and Works applications. (Applicable, but requiring the usual fiddling around necessary to get the qualification and syntax correct for accessing members. Just because nearly all contemporary computer programs use a print method, for instance, that doesn't mean it's a universal usage. As you'll see in this chapter, Word and Excel use the term printout.)

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

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