>>
Application.DataToClip(alias(),reccount(),3)
>>_cliptext = strtran(_cliptext,chr(9)+chr(13),chr(13))
>>_cliptext = strtran(_cliptext,chr(13)+chr(13),chr(13))
>>do while occurs(" "+chr(9),_cliptext)>0
>> _cliptext = strtran(_cliptext," "+chr(9),chr(9))
>>enddo
>
>I've done this for Excel - and discovered that _vfp.datatoclip has its limitations. Not only the padding spaces, but some other things which formatted the data in a way I didn't like, so I wrote something likethis:
>
>#define cTab chr(9)
>#define cr chr(13)
>scan
> _outtext=_outtext+Trim(field1)+cTab
> _outtext=_outtext+ctod(datefield)+ctab
> _outtext=_outtext+mline(memofield,1)+ctab
> _outtext=_outtext+alltr(str(nField,11,2))+cr
>ends
>_cliptext=_outtext
>[ paste into excel now]
>
>
>
>It works like a charm - all the formatting is done in VFP, and I was actually shocked to understand that VFP has stronger string functions than Word 97 (or Excel, for that matter). I mean, Word should be a
text> processing oriented tool.
>
>BTW, one thing doesn't work in Excel - I'm writing one column which contains a string, which is used as an index into a lookup table on Sheet2. If this string begins with an alpha char, it works fine; if it contains digits only, the lookup formula returns #N/A. Formatting whole column as text doesn't help. Sometimes pasting the same number from another cell with the same value helps, sometimes it doesn't. Don't have a clue why does it do this.
>
>I've heard there should be some chr(?) to prefix such fields, to have Excel accept them as text containing digits, and not as a number, but wouldn't know which one.
Dragan,
For such situations to be sure I precede them with a '
Cetin