General information
Category:
Coding, syntax & commands
>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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only