Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open a WinWord/Excel file from VFP
Message
 
To
13/03/2000 09:25:04
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00344931
Message ID:
00344976
Views:
21
>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.htm

You 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform