>Hi Eric.
>
>>My problem is that, if there is an error in the file, specifically the lname variable is not defined, the TEXTMERGE gives an error. Is there a way to make it work like the TEXT...ENDTEXT command that just put nothing in the replacement in this case but don't produce any error?
>
>How about having your error handler just RETURN if the error occurs while using TEXTMERGE()? I do that using code like:
This.lTextMerge = .T.
>textmerge(whatever)
>This.lTextMerge = .F.
>
>function Error...
>if This.lTextMerge
> return
>else
> rest of code
>endif
Doug
Many thanks Doug. Most of the time the solution is so simple!