>>>>>>hh="d:\outmail\out"+TTOC(DATETIME())+".dbf"
>>>>>>hh=STRTRAN(hh," "+"")
>>>>>>hh=STRTRAN(hh,":"+"")
>>>>>>hh=STRTRAN(hh,"/"+"")
>>>>>>
>>>>>>
>>>>>>the value of hh is d:\outmail\out07012015084913.dbf
>>>>>>
>>>>>>SELECT outmail
>>>>>>
>>>>>>COPY TO &hh
>>>>>>
>>>>>>I get invalid path or filename - what am I doing wrong?
>>>>>>
>>>>>>d:\outmail dirctory exists exists as does the file outmail
>>>>>
>>>>>Do not use macro, use Name expression instead.
>>>>>Also make sure that "d:\outmail\ folder exists
>>>>>
>>>>>hh="d:\outmail\out"+TTOC(DATETIME())+".dbf"
>>>>>
>>>>>hh=CHRTRAN(hh," :/", "")
>>>>>
>>>>>SELECT outmail
>>>>>TRY
>>>>> md ("d:\outmail\")
>>>>>CATCH
>>>>>ENDTRY
>>>>>
>>>>>COPY TO (hh)
>>>>>
>>>>
>>>>I still get the error - d:\outmail exists
>>>
>>>change code
>>>to
>>>
>>>hh="d:\outmail\out"+TTOC(DATETIME())+".dbf"
>>>
>>>hh=CHRTRAN(hh," :/", "")
>>>
>>>SELECT outmail
>>>TRY
>>> md ("d:\outmail\")
>>>CATCH
>>>ENDTRY
>>>
>>>_CLIPTEXT = hh
>>>
>>>COPY TO (hh)
>>>
>>>
>>>Paste Clipboard content in the next message.
>>>
>>>What happens if you change
>>>
>>>COPY TO (hh)
>>>
>>>to
>>>
>>>COPY TO d:\outmail\outxyz.dbf
>>>
>>>
>>>?
>>That copies fine
>
>first, just try backwards until it fails, adding more steps, going from working example.
>Your Chrtran() looks very suspicious, as it deletes slash and double colon but leaves backslash in path
Have changed my chrtran and it now works fine - thanks for all your help
Specialist in Advertising, Marketing, especially Direct Marketing
I run courses in Business Management and Marketing