>Hi
>
>Thank for your help
>now i can open a existing Word/Excel file from VFP
>i want to learn more about...
>1. how to create a file Word/Excel ---> oWord.documents.????(mfile)
oWord.documents.add()
or
oExcel.Workbooks.add()
You may want to see the some samples at John Harvey web site:
http://home.att.net/~john.harvey/vfpstuff.htmYou should also look at VBA Help file, you can go there from Word/Excel menu:
Tools/Macro/Visual Basic Editor, and there you can open View/Object Browser
You will see all objects methods and properties and you can get help to any of them.
Good way to study it is to create macros (which do what you want) in Word/Excel and then see the macros code. (Tools/Macro/Edit)
You will need to translate the VBA parameters style to VFP style, so VBA code:
ActiveDocument.Save NoPrompt:=True, OriginalFormat:=wdOriginalDocumentFormat
translates to
oWord.ActiveDocument.Save(.t., wdOriginalDocumentFormat)
Here wdOriginalDocumentFormat is a Word constant. You can use those constants as is if you INCLUDE in your VFP program the Word(Excel) constants header file which you can download from UT Files section.
HTH,
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