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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open blank Ms-Word and Ms-Excel within VFP

Status
Not open for further replies.

alisaif

ISP
Apr 6, 2013
418
AE
Hi,

Please refer to the subject, kindly let me know how to do the same.

Thanks

Saif
 
Have you looked at the various FAQ's in this forum area?
You will find what you need there.

However once you have Opened the Word or Excel documents, knowing what to do with them might be something else.

Good Luck,
JRB-Bldr
 
Do you want to simply open a blank document and hand it over to the user to enter the text, save the document, etc? If so, you can do that very easily with ShellExecute(). That function is well-documented, and you should have no problem finding information about it.

Or do you want to open the document, and then have your application fill it with data, save it, etc? For that, you will need to use Automation. You will need to call the Add method of either the Documents or Workbooks collections (for Word and Excel respectively).

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
If you want to do this in automation, you are going to need a copy of office installed on each PC your application is to run on.

Now this means 'installed', not running something like office 365 remotely - as far as I am aware there is no easy/quick/efficient way to automate office 365 from within VFP.

What you could do is use VFP to copy a blank (or part completed) Word or Excel file to an appropriate location and then launch a third party viewer or even editor - but automation would be most likely be quite different to MS Excel and Word...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
It also sounds like you rather want to create a new Word document or Excel Workbook. This can be as simple as having an empty file as "template" you simply copy or by using OLE automation and creating a new document or workbook.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top