On 6/18/14, Juha Manninen <juha.manninen62 at gmail.com> wrote: > How about : > Filename := Trim(Filename); The original code removes trailing spaces only, and Trim() removes more than spaces (and it removes leading blanks as well). Bart