Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can we subclass word.application?
Message
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00144385
Message ID:
00144503
Views:
20
Hi Dave,

If you can live with less performance, what about using THIS_ACCESS? The access method could determine whether the method is part of WordHelper or Word and return the appropriate reference.

Christof

>Now that I've worked a little with oWord = createobject( "word.application" ) I'd like to add some methods to it to make life easier. Like add an EraseDocument() which would just do the couple of lines of VBA calls that it takes.
>
>What I've done so far is create a subclass WordHelper based on my cObject(Line) subclass that instantiates word and gets created like:
>
>
local loWord
>this.moWordHelper = createobject( "WordHelper", @loWord )
>
>if ( ! IsObject( this.moWordHelper ) )
>   * it already complained about Word not found so just quit
>   return .f.
>endif
>
>this.moWord = loWord
>
>This kind of gives a dual interface you can talk to the word object directly using this.moWord (or this.moWordHelper.moWord but I don't like typing that much *s*) or to the Helper functionality using this.moWordHelper.EraseDocument() but I'm not sure I'm totally pleased with this and looking for suggestions. I don't really want to completely wrap moWord that's just too daunting dealing with all of it's interface methods and properties.
--
Christof
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform