>I started working with COPY TO, and the issue of getting data in with no character field delimiters (even spaces won't work for me), but soon realized I have a bigger issue. In many reports, I embed returns in the strings to format the data within an individual cell. For example: a formatted address designed for use in a mail merge. You can imaging the havoc that Word's Text to Table conversion works on that data.
You can convert CRs into "^R" or whatever is word's internal denoting a CR, using StrTran(), before copying out.
>I am going to try passing the data through HTML. I wonder, however: can I push a table onto the clipboard and paste it in somehow? Or, perhaps there's a row by row approach that's faster than a cell by cell population of the table.
>
>In any event, I need a VFP 6 resolution for the time being.
Another approach: select the data you need into a cursor. Then get all of it onto the clipboard:
_vfp.datatoclip(,,3)
Then paste it in Word. This gives you a tab-delimited set of values, with cr/lf between records, which Word can automatically convert into a table. As far as conversion of CRs goes, I figure ^R would confuse Word, but it can be manipulated once you have a table - a search/replace within Word can do that. Just use something like "%%" instead.