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

STRTOFILE() - Create Word document 2

Status
Not open for further replies.

jimstarr

Programmer
Feb 6, 2001
975
US
I'm attempting to create a Word document by concatenating memo fields (RTF) into a large string and using STRTOFILE(). The file is created OK but Word will only display the first memo.

This is VFP9. Any suggestions?

Jim
 
Some Code example of what you are trying to do might help us find the error

David W. Grewe (Dave)
 
RTF documents probably contain an EOF() byte, and it sounds like Word respects that.

You need to find documentation on the RTF standard. Google should help.
 
Jim,

... concatenating memo fields (RTF) into a large string and using STRTOFILE().

Won't work. Each RTF file is a complete document in its own right. You can't concatenate them.

You'll either have to do some tweaking of the RTF code, or find another solution. For example, you could use Word Automation to open a new document, then read in each RTF file in turn, then save the whole thing as new RTF file.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Using Google I found the following tip in a VB forum:

RTF is just a plain text file with markup -- RTF markup. Remove the last line of the first document, remove the first and last line of all the middle documents, and the first line of the last document that you append.

It works perfectly. Thanks everyone!

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top