Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getobject() doesn't work
Message
 
To
16/04/2001 21:00:39
Thomas Ianuzzi
Information Security Consultants, Inc.
Florida, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00495983
Message ID:
00495985
Views:
7
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform