Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using microsoft office with VFP???

Status
Not open for further replies.

bigdad

Programmer
Jul 17, 2001
34
0
0
VE
Hi every body. my problem is that I need open a Microsoft office file from VFP(to be more specific the microsoft word) and my procedure not work.

I´m using this:
public oword
oword=createobject("word.application")
oword.documents.open('c:\myfile.doc')
oword.visible=.t.

if this is wrong please tell me and let me know how I can do it

thanks
bigdad
 
Your code works! I cut and pasted it into the VFP6 command window, changed the file name of the document to one that is available on my computer and varoom MS Word97 loaded with the document opened :) Michael G. Mahnke
Signet Consulting
 
I cut and pasted your code into a VFP6 program. It works very well.

Peter
 
This may be a stupid question, but is Word installed on the machine you are trying to run this on? And, if it is, is it properly registered with the Windows Registry???
Best Regards,
Scott

Please let me know if this has helped [hammer]
 
If you do have Word installed, What version is installed?
 
Well, to every body that are trying to help me: first of all thanks for your help, you makes me happy when you told me that my code work, but I try again and nothing, it is not work to me yet, and really I don´t know why. I installed and unistalled the VFP 5.0 and 6.0 once and again but this not worked.

The error is:
"Error code OLE 0x80080005" after run the procedure

and my Microsoft office version is XP

Bigdad
 
The meaning of this error is:
Server execution failed (0x80080005) Specified OLE object is registered as a local OLE server (.exe file) but the .exe file could not be found or started.

I think it's an issue with OfficeXP.
This might be something that all of us who have developed automation for Office97/2000/etc might worry about; Hopefully it's just an OfficeXP installation error on his machine.

(BTW, for more OLE errors, .. Even though it's a SQL Server help page, it is the only reference to this error, and the Shoe Fits)
 
I'd agree that it's likely an install problem. I just used the code to open a document on my system - OS: XP Pro, Office: XP, VFP: 6.0 SP5 & 7.0 SP1

Rick
 
Bigdad,
Are you using a Private Data Session? If you are, try (humor me here...) and set it to 1 - Default, and see if you get the same response...
Best Regards,
Scott

Please let me know if this has helped [hammer]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top