Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getobject() doesn't work
Message
 
À
16/04/2001 21:00:39
Thomas Ianuzzi
Information Security Consultants, Inc.
Floride, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00495983
Message ID:
00495985
Vues:
8
>MBUDVAR = GETOBJECT('C:\vfprojects\test.doc')

That will create an object reference to a Word Document. In order to get the Word Application itself to be visible, you'll have to do:

MBUDVAR.Parent.Parent.Visible=.T.

This is because the document's parent is an object of class "Documents" and that object's Parent is the Word Application itself.

An alternate way could be to get a Word.Application object and have it open a document and make the application visible:

oWord=createobject("Word.Application")
oDoc=oWord.Documents.Open("c:\vfprojects\test.doc")
oWord.Visible=.T.

This time the oWord object is an object of the Word Application itself and oDoc is a Word Document object. Or you could just do the oWord.Documents.Open without assigning it to a variable... I'm not sure if you need the specific reference directly to the document or not.

It depends on what you want to do after you open the document as to which approach you want to take. Personally, I prefer the 2nd method above and have control over the entire application directly.

Hope this helps...

--Brad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform