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!

Foxpro to Word

Status
Not open for further replies.

badcode

Programmer
Aug 7, 2002
22
0
0
US
Is there a way to create/edit a word document from within Foxpro 6 or greater. I have to assume that word in not available.
 
Word must be available. You can automate it as a COM server. Look in the 'COM and Automation' section of the FAQ area.

Brian
 
What about creating an .rtf file I don't see why an application must be available to create it's file. ie in foxpro you can create a .XLS .WK1 .TXT file and they don'd have to be available. I would assume you could create a .DOC etc file as well?
 
You can use Low Level File Functions: fcreate(),fopen(), fwrite() etc., or the SET TEXTMERGE command. You could write either RTF or HTML files which Word would be able to open.

There are example of HTML file creation (mostly for Excel, but it's the same idea) in the FAQ area.

Basicially, HTML and RTF files are both just text files with TAGs. As long as you know what the tages you want are, you can output them.

Hint: save a file formatted the way you want as an RTF/HTML file and then look at it in notepad or with a MODI COMM.

Brian
 
baltman:

Your comment ....
>>>Hint: save a file formatted the way you want as an RTF/HTML file and then look at it in notepad or with a MODI COMM.

Attracted my attention because I tried that once with a standard Word Document ... thinking I was going to be able to create a word document in the manner your describe.

However, I found that not every formatting feature was dealt with using TAGS. There were formatting effects that were showing up in WORD for which I could find no tag. The conclusion was that there was a formatting MAP somewhere which was storing the formatting codes. This made it much more difficult (impossible I concluded) to deal with things.

Now, RTF might be different and I know that HTML is but just thought I would throw in my experience with this.





Don


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top