Saving the document

Hello,
A small question. When we are executing our appliication and generating the merge fields in the document dynamically everything is working. If there is already a document in the current directory with the same name it is simply over writing it. But when we are not closing the same instance of the application and generating the merge field document instead of over writing it is appending the document. Is it possible to overwrite the document if already exisit. Can we control it ?
Thanks and regards
Austin.

Hi

Thanks for your request. Maybe you can just remove an existing document before starting an application. For example, you can use the following code:

string documentPath = @"C:\Temp\in.doc";
if (File.Exists(documentPath))
    File.Delete(documentPath);

Also, could you please create simple application, which will allow me to replicate the issue on my side? I will check the issue and provide you more information.
Best regards.

Thanks alexey, I am already following this approach. I thought that there might be some thing available inside the component.
Thanks and best regards