10.2 Dj vu

Déjà vu

If you re reading this book from start to finish, as you read this chapter, you ll say to yourself, "Gosh, I ve read this before!" (especially since this is basically the same text as in Chapter 7, "Excel Basics"). Office 2000 is object-oriented, and it s polymorphic. Polymorphism literally means "many forms," and when applied to OOP, it means that different objects have properties and methods that behave consistently. To write a file to disk, you use the Save method, whether you are in Word, Excel, PowerPoint, or Outlook. This does not mean that the Save commands do exactly the same thing there are different things that need to happen when a Word document is saved than when an PowerPoint presentation is saved. There may even be different parameters for each. However, you can be sure that the Save command will save your work to disk.

The benefit of polymorphism is that once you know how to do something in one tool, you know how to do it in the rest. In Office, this is usually true. However, polymorphism does include the ability for methods to accept different parameters, because different objects are exactly that different. So you need to be aware that syntax can (and does) change between Office applications.

There are so many similarities between the Office applications that we could have written this chapter to say things like, "Just use the CreateObject() function as explained in the Word chapter, but use "PowerPoint.Application" instead." We felt that it would be better to have a complete explanation for each application to keep you from having to flip back and forth in the book. It also makes it easier to explain the subtle syntax differences that exist between applications. After we get past the basics of opening and saving files, we get into enough application-specific features that it will seem less repetitive.

Figure 1. The PowerPoint object model. This diagram is available in the Help file and shows the hierarchy of available PowerPoint objects.

The benefit of polymorphism is that once you know how to do something in one object, you know how to do it in all of them. However, explaining similar concepts for each object makes for redundant text. Just think of this redundant text as a "feature."

 

Copyright 2000 by Tamar E. Granor and Della Martin All Rights Reserved



Microsoft Office Automation with Visual FoxPro
Microsoft Office Automation with Visual FoxPro
ISBN: 0965509303
EAN: 2147483647
Year: 2000
Pages: 128

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