All of this is in the Microsoft manuals, and the MSDN Library which is online at http://msdn.microsoft.com/library/default.asp.
You can learn a lot by recording a macro in Excel or Word and opening it in the VBA editor to see what's there. You'll get a lot of ideas for how to write the code in Visual FoxPro.
You might also like reading Tamar Granor and Della Martin's book. See http://www.hentzenwerke.com/catalogavailability/autofox.htm.
>Hi, Thanks for help.
>It works.
>I used
>MDOCFILE = CREATEOBJECT("Excel.Application")
>MDOCFILE.WorkBooks.Add('C:\Excel\MYDOC.XLS')
>MDOCFILE.Visible = .T.
>Then it will open Excel and the file MYDOX.XLS.
>Do you know where can I know it will be ".WorkBooks" in Excel and it will be ".Document" in Word?
>From Mircosoft's manual?
>
>
>>Power,
>>
>>Try:
>>MDOCFILE = CREATEOBJECT("Word.Application")
>>MDOCFILE.Documents.Add('C:\WRDPROC\MYDOC.DOC')
>>MDOCFILE.Visible = .T.
>>
>>>I have tried to put this inside a button
>>>MDOCFILE = GETOBJECT('C:\WRDPROC\MYDOC.DOC')
>>>or
>>>MBUDVAR = GETOBJECT('C:\Excel\aaa.XLS')
>>>and then run it.
>>>I got nothing happened on my screen. A short period of the loading symbol "sand watch" then nothing. What should I do to open an OLE automation object in its application like Excel or Word?
>>>
>>>Power