How to copy and replace a file in the vault?

Hello All,

I want to copy a file from a source folder to the EPDM vault.

If the file already exists in the vault and it is checked out by me, I would like to create a new version of it.

Using the regular U/I (not the API), if I perform copy+paste in this situation I get a messgae: "The folder already contains a file named "XXX". Do you want to replace it with "XXX"?". If I now choose "Yes", the local copy is replaced and when I next check in the file, it has a new version.

(see picture).

How can it be done using API?

I tried to use IEdmFolder5::AddFile, but I get execption.

Any ideas?

Thanks

Keren

SolidworksApi macros