>Hi, everyone
>
>Q-A.
>i want to open a Word/Excel from VFP program, how to do it.
>*** my program
>mfile = " "
>@ 2,2 get mfile
>read
>>>>>open the Word/Excel file<<<<
>*** end of program
>
public oWord && oExcel
oWord = CREATEOBJECT("word.application")
* oExcel= CREATEOBJECT("excel.application")
oWord.Visible = .t. && optional if you want it visible
myDocument = mfile
oWord.documents.open(myDocument)
* .oExcel.WorkBooks.Open(mfile)
I see you are using FoxPro 2.x style to get your filename. Why don't just use the textbox on your form and get the mfile from textbox.value?
Nick
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro
"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison