Can I overwrite existing files with Doc.save?

An overwrite option does not seem to exist.
I want my application to always use the same filename and overwrite it when it already exists.
Now, it does not overwrite, and generates new ones with indexes, 1,2,3…
Example:
original file:
test.pdf

recreated files:
test(1).pdf,
test(2).pdf

Hi,

Note that DocumentModel.Save method doesn’t have that behavior.

It will overwrite the existing file on the provided path; it will not generate the file on a new path with an index.

Regards,
Mario

Hi Mario, thanks for the quick reply.
I am already using the DocumentModel as follows and it does not overwrite the same file, it will generate a new one.

'Create new empty document.
Dim doc As New DocumentModel()
'...
doc.Sections.Add(section1)
doc.Sections.Add(section2)
'...
myfile = "d:\test\test.pdf"
doc.Save(myfile)

Ok, investigated it a bit further. My doc.save indeed overwrites the existing file. Reason why it failed with me. If I click my ‘create pdf’ button multiple times too quick, the generation of the first pdf is probably still busy, and locks the first pdf. As a result, a new pdf (1), (2) etc… will be generated instead. Case closed then. Thank you!