Microsoft Office Automation with Visual FoxPro

Structuring the wrapper classes

The rest of this chapter explores a set of wrapper classes for the Office servers. At the top of the class hierarchy, there s an abstract class called cusWrapServer based on the Visual FoxPro Custom class. It has several custom properties and methods, the details of which are explored in the following sections. (In fact, while Custom is technically the right class for this, since the wrapper classes don t need the container capabilities of Custom, consider starting with a simpler class like Line that doesn t use as many resources as Custom.)

The cusWrapServer class can be subclassed to create individual wrapper classes for Word, Excel, and PowerPoint (and probably for some other Automation servers, as well). Outlook s object model is so different from the other Office servers that this wrapper class structure isn t appropriate for it, but of course, you can develop a wrapper class for Outlook.

All of the classes described in this chapter are included in the Developer Download files available at www.hentzenwerke.com. Because some of the features used in the classes are unique to VFP 6, which prevents the classes from being opened in the Class Designer in older versions, a code version is provided in addition to the class library.

 

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

Категории